Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error during installation #111

Closed
jmachace opened this issue Aug 25, 2021 · 22 comments
Closed

Syntax error during installation #111

jmachace opened this issue Aug 25, 2021 · 22 comments

Comments

@jmachace
Copy link

Describe the bug
Syntax error when installing:
python setup.py develop

To Reproduce
Upon recloning:
git clone git://github.com/michaelhush/M-LOOP.git

Running installation:
python setup.py develop

Expected behavior
Successful completion of installation.

Screenshots
/tmp/easy_install-y_M61L/pytest-runner-5.3.1/temp/easy_install-UeIPEu/setuptools_scm-6.0.1/src
<pkg_resources.WorkingSet object at 0xb59f03d0>
Traceback (most recent call last):
File "setup.py", line 73, in
main()
File "setup.py", line 68, in main
'Topic :: Scientific/Engineering :: Physics']
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 144, in setup
_install_setup_requires(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 724, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1077, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 791, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 704, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 730, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 915, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1183, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1169, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-y_M61L/pytest-runner-5.3.1/setup.py", line 21, in
name = 'M-LOOP',
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 144, in setup
_install_setup_requires(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 724, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1077, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 791, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 704, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 730, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 915, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1183, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1169, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-y_M61L/pytest-runner-5.3.1/temp/easy_install-UeIPEu/setuptools_scm-6.0.1/setup.py", line 52, in
download_url = 'https://github.com/michaelhush/M-LOOP/tarball/3.2.1',
File "/tmp/easy_install-y_M61L/pytest-runner-5.3.1/temp/easy_install-UeIPEu/setuptools_scm-6.0.1/setup.py", line 29, in scm_config

File "/tmp/easy_install-y_M61L/pytest-runner-5.3.1/temp/easy_install-UeIPEu/setuptools_scm-6.0.1/src/setuptools_scm/init.py", line 8, in
File "/tmp/easy_install-y_M61L/pytest-runner-5.3.1/temp/easy_install-UeIPEu/setuptools_scm-6.0.1/src/setuptools_scm/config.py", line 6, in
File "/tmp/easy_install-y_M61L/pytest-runner-5.3.1/temp/easy_install-UeIPEu/setuptools_scm-6.0.1/src/setuptools_scm/utils.py", line 41
print(*k)
^
SyntaxError: invalid syntax

Desktop (please complete the following information):

  • OS: Raspbian GNU/Linux 10 (buster)
@zakv
Copy link
Collaborator

zakv commented Aug 25, 2021

Hi jmachace,

It looks to me like there is something weird going on with your python environment/installation. The error you see is that the print() function (with parentheses) is Python 3 syntax, but you are using a Python 2.7 install. It looks like that print() statement is in the setuptools tools package (not part of M-LOOP), so it seems like maybe you've somehow ended up with a Python 3 version of setuptools installed in a Python 2.7 environment.

Try using pip install -e <path/to/M-LOOP> instead of python setup.py develop for a development install and let me know if that works. That's the command I use to install M-LOOP. According to this Stack Overflow post, using python setup.py develop can lead to installing incompatible versions of dependencies, so that may be the source of your issue. You may have to manually uninstall any dependencies that were automatically installed when running python setup.py develop.

If using pip install -e fixes the issue then I'll update the docs (note to self: source here, rendered here and need to update README.rst) to recommend that procedure instead.

On a side note, Python dropped support for version 2.7 a while ago. Unless you have a specific reason for using Python 2.7, I would recommend using Python 3.

Cheers,
Zak

@jmachace
Copy link
Author

Hi Zak,
Thanks for the prompt reply.
Yes, sorry, I forgot to update.

Upon updating I tried the original command python setup.py develop, which returned the following:
sudo python setup.py develop
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt))
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt))
running develop
running egg_info
writing M_LOOP.egg-info/PKG-INFO
writing dependency_links to M_LOOP.egg-info/dependency_links.txt
writing entry points to M_LOOP.egg-info/entry_points.txt
writing requirements to M_LOOP.egg-info/requires.txt
writing top-level names to M_LOOP.egg-info/top_level.txt
reading manifest file 'M_LOOP.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.7/dist-packages/M-LOOP.egg-link (link to .)
M-LOOP 3.2.1 is already the active version in easy-install.pth
Installing M-LOOP script to /usr/local/bin

Installed /home/pi/M-LOOP
Processing dependencies for M-LOOP==3.2.1
Searching for tensorflow>=2.0.0
Reading https://pypi.org/simple/tensorflow/
No local packages or working download links found for tensorflow>=2.0.0
error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.0.0')

I then used sudo pip install -e <path/to/M-LOOP> returning:
sudo python setup.py develop
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt))
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt))
running develop
running egg_info
writing M_LOOP.egg-info/PKG-INFO
writing dependency_links to M_LOOP.egg-info/dependency_links.txt
writing entry points to M_LOOP.egg-info/entry_points.txt
writing requirements to M_LOOP.egg-info/requires.txt
writing top-level names to M_LOOP.egg-info/top_level.txt
reading manifest file 'M_LOOP.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.7/dist-packages/M-LOOP.egg-link (link to .)
M-LOOP 3.2.1 is already the active version in easy-install.pth
Installing M-LOOP script to /usr/local/bin

Installed /home/pi/M-LOOP
Processing dependencies for M-LOOP==3.2.1
Searching for tensorflow>=2.0.0
Reading https://pypi.org/simple/tensorflow/
No local packages or working download links found for tensorflow>=2.0.0
error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.0.0')

It appears that tensorflow >= 2.0.0 is not available.

Cheers,
Josh

@zakv
Copy link
Collaborator

zakv commented Aug 26, 2021

Interesting. Just to double check, both commands gave essentially the same output? Just want to make sure that there wasn't a copy/paste mistake. It wouldn't be unreasonable for them to be the same; I don't know pip's inner workings so it might run setup.py and then give similar output.

Just navigating to https://pypi.org/simple/tensorflow/ in my browser seems to show a list of tensorflow package versions. It has versions up to 2.6.0, including packages for linux. What happens if you run pip install tensorflow? You may also want to try having pip list what versions of tensorflow are available using the command listed here for your version of pip.

@jmachace
Copy link
Author

I've removed tensorflow 1.14, but after updating it still installs tensorflow 1.14.
I tried the python setup.py develop, but got the following:
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt))
/usr/local/lib/python3.7/dist-packages/setuptools/dist.py:700: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt))
running develop
running egg_info
writing M_LOOP.egg-info/PKG-INFO
writing dependency_links to M_LOOP.egg-info/dependency_links.txt
writing entry points to M_LOOP.egg-info/entry_points.txt
writing requirements to M_LOOP.egg-info/requires.txt
writing top-level names to M_LOOP.egg-info/top_level.txt
reading manifest file 'M_LOOP.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.7/dist-packages/M-LOOP.egg-link (link to .)
M-LOOP 3.2.1 is already the active version in easy-install.pth
Installing M-LOOP script to /usr/local/bin

Installed /home/pi/M-LOOP
Processing dependencies for M-LOOP==3.2.1
Searching for tensorflow>=2.0.0
Reading https://pypi.org/simple/tensorflow/
No local packages or working download links found for tensorflow>=2.0.0
error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.0.0')

I've found some instructions on installing tensorflow 2.2.0, so I'll give that a go assuming I've not done something silly.

@jmachace
Copy link
Author

I've tried installing on a different machine (Jetson Nano w/ Jetpack 4.6), but get the same error.
I must be doing something silly. However, I am following the directions. Specifically, I am cloning and then running python setup.py develop. I get essentially the same error involving the tensorflow version.

running develop
running egg_info
creating M_LOOP.egg-info
writing M_LOOP.egg-info/PKG-INFO
writing dependency_links to M_LOOP.egg-info/dependency_links.txt
writing entry points to M_LOOP.egg-info/entry_points.txt
writing requirements to M_LOOP.egg-info/requires.txt
writing top-level names to M_LOOP.egg-info/top_level.txt
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
reading manifest file 'M_LOOP.egg-info/SOURCES.txt'
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.6/dist-packages/M-LOOP.egg-link (link to .)
Adding M-LOOP 3.2.1 to easy-install.pth file
Installing M-LOOP script to /usr/local/bin

Installed /home/josh/M-LOOP
Processing dependencies for M-LOOP==3.2.1
Searching for tensorflow>=2.0.0
Reading https://pypi.python.org/simple/tensorflow/
No local packages or working download links found for tensorflow>=2.0.0
error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.0.0')

@zakv
Copy link
Collaborator

zakv commented Aug 26, 2021

Hi jmachace,

I'm not sure why the machines are having a hard time getting a recent tensorflow version installed. Could you run the following commands in order and send me the output from each?
pip --version
pip install tensorflow==2.6.0
pip install -e <path/to/M-LOOP>

@jmachace
Copy link
Author

Hi zakv,
Yep. I had some issues so used '-H'.
Also, my python version is 3.6.9.

pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

sudo -H pip3 install tensorflow==2.6.0
Collecting tensorflow==2.6.0
Could not find a version that satisfies the requirement tensorflow==2.6.0 (from versions: )
No matching distribution found for tensorflow==2.6.0

`sudo -H pip3 install -e /home/josh/M-LOOP/'
Obtaining file:///home/josh/M-LOOP
Collecting docutils>=0.3 (from M-LOOP==3.2.1)
Using cached https://files.pythonhosted.org/packages/4c/5e/6003a0d1f37725ec2ebd4046b657abb9372202655f96e76795dca8c0063c/docutils-0.17.1-py2.py3-none-any.whl
Requirement already satisfied: matplotlib>=1.5 in /usr/lib/python3/dist-packages (from M-LOOP==3.2.1)
Requirement already satisfied: numpy>=1.11 in /usr/lib/python3/dist-packages (from M-LOOP==3.2.1)
Requirement already satisfied: pip>=7.0 in /usr/lib/python3/dist-packages (from M-LOOP==3.2.1)
Collecting pytest>=2.9 (from M-LOOP==3.2.1)
Using cached https://files.pythonhosted.org/packages/a1/59/6821e900592fbe261f19d67e4def0cb27e52ef8ed16d9922c144961cc1ee/pytest-6.2.4-py3-none-any.whl
Collecting scikit-learn>=0.18 (from M-LOOP==3.2.1)
Using cached https://files.pythonhosted.org/packages/05/04/507280f20fafc8bc94b41e0592938c6f4a910d0e066be7c8ff1299628f5d/scikit-learn-0.24.2.tar.gz
Complete output from command python setup.py egg_info:
Partial import of sklearn during the build process.
Traceback (most recent call last):
File "/tmp/pip-build-z1chq5v_/scikit-learn/sklearn/_build_utils/init.py", line 27, in _check_cython_version
import Cython
ModuleNotFoundError: No module named 'Cython'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-z1chq5v_/scikit-learn/setup.py", line 301, in <module>
    setup_package()
  File "/tmp/pip-build-z1chq5v_/scikit-learn/setup.py", line 297, in setup_package
    setup(**metadata)
  File "/usr/lib/python3/dist-packages/numpy/distutils/core.py", line 135, in setup
    config = configuration()
  File "/tmp/pip-build-z1chq5v_/scikit-learn/setup.py", line 186, in configuration
    _check_cython_version()
  File "/tmp/pip-build-z1chq5v_/scikit-learn/sklearn/_build_utils/__init__.py", line 30, in _check_cython_version
    raise ModuleNotFoundError(message) from e
ModuleNotFoundError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source.

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-z1chq5v_/scikit-learn/

@zakv
Copy link
Collaborator

zakv commented Aug 26, 2021

Hmm, that's a very old version of pip. I would suggest updating it then repeating those commands.

@jmachace
Copy link
Author

Okay, so I've installed Ubuntu 21.04 on a Pi400 and updated.
python3 --version returns Python 3.9.5
Installed pip3
pip --version returns pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
pip install M-LOOP appears to work.

Downloading M-LOOP-3.2.0.tar.gz (61 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cfu05yit/m-loop_5225362e0a894002851222875f60f893/setup.py'"'"'; file='"'"'/tmp/pip-install-cfu05yit/m-loop_5225362e0a894002851222875f60f893/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-fvm33oum
cwd: /tmp/pip-install-cfu05yit/m-loop_5225362e0a894002851222875f60f893/
Complete output (7 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-cfu05yit/m-loop_5225362e0a894002851222875f60f893/setup.py", line 70, in
main()
File "/tmp/pip-install-cfu05yit/m-loop_5225362e0a894002851222875f60f893/setup.py", line 14, in main
with open(path.join(this_directory, 'DESCRIPTION.rst'), encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-cfu05yit/m-loop_5225362e0a894002851222875f60f893/DESCRIPTION.rst'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/61/15/47f14f06d2bdf4dd754a241a885f1b37217d4fe43fde25ebcd55465f0a1a/M-LOOP-3.2.0.tar.gz#sha256=410c472c8dfbe268c1be53fd4c68e3eaf8d70f03eb490998ec9501e5a0a1c5d0 (from https://pypi.org/simple/m-loop/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Successfully built M-LOOP
Installing collected packages: pyparsing, numpy, toml, threadpoolctl, scipy, py, pluggy, packaging, kiwisolver, joblib, iniconfig, cycler, attrs, scikit-learn, pytest, matplotlib, docutils, M-LOOP
WARNING: The scripts f2py, f2py3 and f2py3.9 are installed in '/home/josh/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts py.test and pytest are installed in '/home/josh/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script M-LOOP is installed in '/home/josh/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

So it is installing into the wrong path. Have I done something wrong?

I thought I had all of the dependencies, so I tried installing from source.
'git clone git://github.com/michaelhush/M-LOOP.git'
'cd M-LOOP/'
'sudo python3 setup.py develop' which returns

running develop
running egg_info
creating M_LOOP.egg-info
writing M_LOOP.egg-info/PKG-INFO
writing dependency_links to M_LOOP.egg-info/dependency_links.txt
writing entry points to M_LOOP.egg-info/entry_points.txt
writing requirements to M_LOOP.egg-info/requires.txt
writing top-level names to M_LOOP.egg-info/top_level.txt
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
reading manifest file 'M_LOOP.egg-info/SOURCES.txt'
writing manifest file 'M_LOOP.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.9/dist-packages/M-LOOP.egg-link (link to .)
Adding M-LOOP 3.2.1 to easy-install.pth file
Installing M-LOOP script to /usr/local/bin

Installed /home/josh/M-LOOP
Processing dependencies for M-LOOP==3.2.1
Searching for tensorflow>=2.0.0
Reading https://pypi.org/simple/tensorflow/
No local packages or working download links found for tensorflow>=2.0.0
error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.0.0')

I'm getting the same error.
'pip3 install tensorflow'
ERROR: Could not find a version that satisfies the requirement tensorflow
ERROR: No matching distribution found for tensorflow

@zakv
Copy link
Collaborator

zakv commented Aug 28, 2021

Ah sorry that installation is proving so difficult.

For some reason, pip install M-LOOP attempted to install M-LOOP version 3.2.0 even though 3.2.1 is the most recent version. My understanding is that version 3.2.0 had an issue which leads to that ERROR: Command errored out with exit status 1: problem during installation. I believe that was fixed in version 3.2.1 (by #103). Could you try running pip install M-LOOP==3.2.1 and send me the output of that?

I don't think that pip install M-LOOP is installing to the wrong path. I believe that warning is just telling you that the M-LOOP script to start it from the command line (as mentioned in the docs here) was put in a directory that isn't part of your PATH variable (which tells your computer where to look for programs when you type their name in a terminal). All that means is that if you want to run that script, then you would need to either (a) include the path when invoking the script, e.g. /home/josh/.local/bin/M-LOOP -c [config_filename], (b) add /home/josh/.local/bin to your path variable, or (c) cd to /home/josh/.local/bin before running the script. Note that you only need to do that when running M-LOOP directly from the terminal. None of those steps are necessary if you run M-LOOP from a Python script (e.g you should be able to run this example without doing any of those steps).

I know that the docs suggest running python setup.py develop to make an editable install, but I would advise against that (that's an old/outdated approach which has some issues; I'll update the docs later). I would recommend running pip install -e <path_to_mloop> instead of python setup.py develop, as that's the modern way to achieve the same goal.

I'm not sure why pip is struggling to find a download for tensorflow. I believe that's the root cause of why M-LOOP isn't installing right. Could you try running pip install --use-deprecated=legacy-resolver tensorflow== and send me the output? That should list the versions of tensorflow that it can find.

After a bit of googling it seems like you're not the only one to have issues installing tensorflow with pip. If the above command to list available tensorflow versions doesn't give any recent versions, consider trying the approach described here. Given your system and Python version I believe your command should be python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.6.0-cp39-cp39-manylinux2010_x86_64.whl

@zakv
Copy link
Collaborator

zakv commented Aug 28, 2021

Could you also send me the output of python3 -c "import sys;print('%x' % sys.maxsize, sys.maxsize > 2**32)"? That should indicate if you have 32 bit or 64 bit Python. Tensorflow only works with 64 bit Python, so that could possibly be the issue.

@jmachace
Copy link
Author

Ran the following: python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.6.0-cp39-cp39-manylinux2010_x86_64.whl
Returned:
Defaulting to user installation because normal site-packages is not writeable ERROR: tensorflow_cpu-2.6.0-cp39-cp39-manylinux2010_x86_64.whl is not a supported wheel on this platform.

python3 -c "import sys;print('%x' % sys.maxsize, sys.maxsize > 2**32)"
Returned: 7fffffffffffffff True ...

@jmachace
Copy link
Author

python3
Python 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import platform
platform.architecture()
('64bit', 'ELF')

@zakv
Copy link
Collaborator

zakv commented Aug 29, 2021

Ok so we've narrowed down the problem to the fact that tensorflow won't install for some reason. You have a 64bit Python installation, so the issue is something else. I'd suggest following the steps listed here to get tensorflow 2 installed on your Pi400 (though note that the command listed there is for Python 3.7 so you'll need a different url). Any version 2.x.x should be ok for M-LOOP. I'd also suggest googling instructions for installing tensorflow 2 on your Jetson Nano if you'd like to do that as well. It seems like the installation is slightly different for those particular platforms than for a typical linux machine.

Once you get tensorflow installed successfully, run either pip install M-LOOP==3.2.1 for a normal installation or pip install -e <path/to/M-LOOP> for a development install. The normal installation will install the latest released version of M-LOOP. The developer install is only required if you want to try editing M-LOOP's code yourself or if you want to try out the latest yet-to-be-released changes to M-LOOP.

@zakv
Copy link
Collaborator

zakv commented Aug 29, 2021

You may also want to take a look at this issue: tensorflow/tensorflow#29704

@jmachace
Copy link
Author

I am able to install M-LOOP version 2.2.0, but then have other issues that appear to be related to the python environment on the Pi boxes I've tried. So I went to a windows 10 box, installed anaconda and then installed M-LOOP by cloning from git and running python setup.py test.
I got an error related the numpy version corrected by installing numpy specifically which forced an update of conda.
I then ran python setup.py test which appears to have worked returning the following
tests\test_examples.py .....F........
I say "appears" since I got an F and it hangs.

@zakv
Copy link
Collaborator

zakv commented Aug 31, 2021

Sorry that the pi boxes are turning out to be such a struggle, but I'm glad you got it working on the windows machine.

And yep, looks like the shell_interface_config test hangs at the moment. I'll file a separate issue for that, thanks for noticing! I'll file a separate issue to update the docs about the recommended editable installation procedure as well. Other than those two problems, it seems like all of the other points in this issue are external to M-LOOP right? Namely difficulties with tensorflow installation and python environments?

@zakv
Copy link
Collaborator

zakv commented Aug 31, 2021

Ok, many of the problems discovered in this issue are now logged separately and have fixes which will likely be merged soon.

I'll likely merge those changes in the next day or two. After that you'll be able to get them on your machines by running git pull in the M-LOOP directory.

@jmachace
Copy link
Author

Thanks.

@zakv
Copy link
Collaborator

zakv commented Sep 1, 2021

Just merged the PR's mentioned above into the master branch. The installation and testing instructions should be updated (you'll need to look at the "latest" documentation rather than the default "stable" documentation). Also, the tests should no longer hang and should all pass.

At this point all of your difficulties are external to M-LOOP, correct? If so I'll close this issue to mark it as resolved. If I do that, you're still welcome to comment on this issue. In fact I would encourage you to do so, that way any other users who would like to run M-LOOP on similar devices could benefit from your experience. I'll also continue to respond to your comments and answer any questions to the best of my abilities, though admittedly I do not have experience with your particular devices.

I believe that I'll still get notifications if you comment on this issue after it is closed. However, feel free to @ me if I don't respond, which will ensure that I am notified.

@zakv
Copy link
Collaborator

zakv commented Oct 20, 2021

Hi jmachace,

This issue has been idle for a while. It seems like all of the remaining problems were external to M-LOOP (i.e. related to getting tensorflow to install on various hardware)? If so I'll close this issue.

Thanks for the bug report by the way!

Cheers,
Zak

@zakv
Copy link
Collaborator

zakv commented Oct 29, 2021

Closing due to inactivity, but feel free to reopen if there are any more unresolved M-LOOP bugs related to this issue.

@zakv zakv closed this as completed Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants