Giter Club home page Giter Club logo

Comments (17)

vsbogd avatar vsbogd commented on August 16, 2024

I personally use Python 3.10.4 with Nosetests 1.3.7 and it works. I don't see the hyperon code in the stack trace you posted, so I think it is probably some compatibility issue between Python and Nosetests which are installed on your system. The possible root cause is CMake finds incorrect version of Python or Nosetests somewhere in the system.

Could you please check paths to your executable files, to do this run the following command in ./build directory:

cmake --system-information  | grep EXECUTABLE | egrep 'NOSE|PYTHON'

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

I have multiple python versions in my system and CMake keeps getting the older one and was unable to find hyperonpy module. So I created a virtual environment with Python 3.10 and that's what I used to build hyperon.

The output of the above command

NOSETESTS_EXECUTABLE:FILEPATH=/home/hedra/SNET/hyperon-experimental/venv/bin/nosetests
PYTHON_EXECUTABLE:FILEPATH=/home/hedra/SNET/hyperon-experimental/venv/bin/python
//ADVANCED property for variable: PYTHON_EXECUTABLE
PYTHON_EXECUTABLE-ADVANCED:INTERNAL=1

Python and Nosetests versions in the venv

(venv) build $nosetests --version
nosetests version 1.3.7
(venv) build $python --version
Python 3.10.4
(venv) build $

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Versions are definitely ok, and CMake finds tools right. I did't know nose is outdated and replaced by nose2. I found nice analysis of the issue here: nose-devs/nose#1099.

I am not sure why python -m pip install -e ./python[dev] works to me and others but doesn't work in your environment but it seems that PyPi version of nose is broken and should be built from sources to be compatible with Python 3.10. I can suggest trying pip install -U nose --no-binary :all: to rebuild nose from source as mentioned here as a workaround. Please write back if it work or not.

As a long term solution it is probably better to migrate to pytest or nose2. @noskill do you have any preferences here?

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

The installation python -m pip install -e ./python[dev] works for me as well.

I only got the above AttributeError: module 'collections' has no attribute 'Callable' error during cmake build specifically when I do make check.

The suggestion to rebuild nose doesn't seem to update anything, this what I get when I try:

(venv) hyperon-experimental $pip install -U nose --no-binary :all:
Requirement already satisfied: nose in ./venv/lib/python3.10/site-packages (1.3.7)

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Try this one, to force reinstall package:

pip install -U --force-reinstall  nose --no-binary :all:

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

The force reinstall fixes the collections error. But got another error with the print statement

    from nose import main
  File "/home/hedra/SNET/hyperon-experimental/venv/lib/python3.10/site-packages/nose/__init__.py", line 1, in <module>
    from nose.core import collector, main, run, run_exit, runmodule
  File "/home/hedra/SNET/hyperon-experimental/venv/lib/python3.10/site-packages/nose/core.py", line 153
    print "%s version %s" % (os.path.basename(sys.argv[0]), __version__)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Looks like it generated a module for a Python 2. Do you have pip installed in your environment? What does pip --version show?

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

Yes, it is 21.3.1

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

To me pip also prints a Python version:

$ pip --version
pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10)

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

I only send the version sorry,

(venv) build $pip --version
pip 21.3.1 from /home/hedra/SNET/hyperon-experimental/venv/lib/python3.10/site-packages/pip (python 3.10)

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Ok, it looks strange: your environment seems to be consistent but somehow it generates Python 2 code during installation of the nose module.

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

I am not sure how pip works here. Guys in nose issue thread mentioned that nose for a Python 3 is converted from Python 2 code. Looks like in your case this doesn't work. Could you please execute: pip install -v -U --force-reinstall nose --no-binary :all: 2>&1 | tee /tmp/pip.log and attach the /tmp/pip.log file to the issue.

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

pip.log

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Ok, log shows that nose is definitely installed as a Python 2 app. Python tries to compile it but cannot because of compatibility errors. As a last hope please try:

pip uninstall -y nose
pip install nose-py3

May be it will help.

from hyperon-experimental.

tanksha avatar tanksha commented on August 16, 2024

It works. Thanks!
My nosetest version is now 1.4.
Closing the issue.

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Unfortunately nose-py3 has an issue itself: atsb/nose-py3#1 (comment) so I cannot recommend this workaround as a general solution.

from hyperon-experimental.

vsbogd avatar vsbogd commented on August 16, 2024

Looks like it works when Nosetests is installed using a system package manager or using environment like Anaconda which also install packages from own repo not from PyPi.

from hyperon-experimental.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.