[CLOSED] Netifaces error after fresh install from source


#6

Hm. Then let’s “rebuild” the CLE repo, which is supposed to install netifaces.

cd $HBP/CLE
make devinstall

See if it says that it’s downloading netifaces and if there is any error about it.

Regards
Axel


#7

When running make devinstall it shows this error:

Using cached https://files.pythonhosted.org/packages/ea/f1/831fa9763afc85d3065557762824490d6e4d1afe1a56e0f053a568ae0cb5/sortedcollections-1.2.1-py2.py3-none-any.whl
Collecting enum-compat (from spalloc<3.0.0,>=2.0.1->sPyNNaker8->hbp-nrp-cle==3.0.0)
Using cached https://files.pythonhosted.org/packages/41/46/8ed2368976d934652d8f33f1fdd86f5580fab45e890c90a848e83097a093/enum-compat-0.0.3.tar.gz
Collecting tzlocal (from spalloc<3.0.0,>=2.0.1->sPyNNaker8->hbp-nrp-cle==3.0.0)
Using cached https://files.pythonhosted.org/packages/79/8c/7d9608dd2643a144bd473405d268973ee1c67aac4c72c4d73910dc8a4754/tzlocal-3.0b1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-HzBxcz/tzlocal/setup.py”, line 1, in
from pathlib import Path
ImportError: No module named pathlib

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

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-HzBxcz/tzlocal/
You are using pip version 9.0.3, however version 20.2.3 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

and I still can’t find netifaces in $HOME/.opt/platform_venv/lib/python2.7/site-packages.

Regards
schwaben


#8

Ok, add ubuntu package python-pathlib

sudo apt-get install python-pathlib

rerun make devinstall in the CLE directory and copy the lines mentioning netifaces or other issues.


#9

Hi,
I installed python-pathlib and reran make devinstall, but it still shows the same error:

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-CWTtft/tzlocal/setup.py", line 1, in <module>
    from pathlib import Path
ImportError: No module named pathlib

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

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-CWTtft/tzlocal/

When I type pip list in the terminal, both netifaces 0.10.4 and pathlib 1.0.1 are on that list, although I did not sudo apt-get install netifaces.
Both are installed at /usr/lib/python2.7/dist-packages. That is probably the reason why it can’t import netifaces, but why is it unable to find pathlib?

Regards
schwaben


#10

Maybe there are in the global python packages and were installed with pip for some reason.
Uninstall them:

pip uninstall netifaces pathlib

Then run make devinstall in CLE.


#11

Warning, there was an error in my previous post. I fixed it, but please ignore the email and go to the forum post to see the updated version.


#12

Thank you for your answer.
Uninstalling them with pip uninstall netifaces pathlib doesn’t work

Not uninstalling netifaces at /usr/lib/python2.7/dist-packages, outside environment /usr
Not uninstalling pathlib at /usr/lib/python2.7/dist-packages, outside environment /usr

so they probably weren’t installed using pip. Should I run sudo apt-get purge netifaces pathlib, or would that also remove other dependencies I might still need?

The only fixes I found on the internet for the packages being installed in the wrong directory were adding /usr/lib/python2.7/dist-packages to $PYTHONPATH, which breaks something else according to this post ([SOLVED] Error after fresh install from source) or installing it with pip to a certain location, which might not work because of the conflict of pip and apt-get.

I also noticed that I don’t have $HOME/.local/lib/python2.7/dist-packages folder mentioned in the README.md on bitbucket, but only a $HOME/.local/lib/python2.7/site-packages containing the NEST related stuff. Could that be an issue?


#13

Actually, I also only have the $HOME/.local/lib/python2.7/site-packages. This is not the issue (I’ll change the doc later when we fix this).
First, did you try sudo-ing your pip uninstall command?

sudo pip uninstall netifaces pathlib
sudo apt-get install python-pathlib
cd $HBP/CLE
make devinstall

If no success, let’s try to find where your packages are installed, activate the NRP virtual_env and load the modules and find their location:

source $HOME/.opt/platform_venv/bin/activate
python  # this starts an interactive python within the NRP virtual env
import netifaces
netifaces.__file__   # this should return the path of the .so netifaces library
exit()  # to exit the python interpreter
deactivate   # to get out of the virtual env

#14

sudo-ing pip uninstall didn’t work.
Import netifaces fails with ImportError: No module named netifaces.

If I enter pip show netifaces I get

Name: netifaces
Version: 0.10.4
Location: /usr/lib/python2.7/dist-packages

and some more info. In this folder there are netifaces.so and a folder netifaces-0.14.4.egg-info.
With apt list --installed I get
python-netifaces/bionic,now 0.10.4-0.1build4 amd64 [installed,automatic]


#15

Hi,

Obviously the system netifaces was not removed. Something went wrong with the apt-get remove python-netifaces.
I tried it on my computer (cause I have both the system and NRP versions of netifaces). If I try to apt-get remove python-netifaces, it will uninstall the whole ROS, which we don’t want to do.

Maybe, if system netifaces is hidden from the NRP virtual env, try to activate it before you make devinstall. If it doesn’t find it, it will for sure download the 0.8 version into $HOME/.opt/platform_venv.

source $HOME/.opt/platform_venv/bin/activate
cd $HBP/CLE
make devinstall
deactivate

#16

Hi,
make devinstall fails because it can’t find pathlib:

ImportError: No module named pathlib
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_X6Qsv/tzlocal/

After I installed pathlib with pip in the virtual environment, it showed a new error`

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-2XKUuH/tzlocal/setup.py", line 8, in <module>
        + Path('CHANGES.txt').read_text('utf-8'))
AttributeError: 'PosixPath' object has no attribute 'read_text'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2XKUuH/tzlocal/

The only solution to that seems to be to use python 3.5 (https://github.com/aio-libs/aiohttp/issues/2741).


#17

Hi,
is it possible that the error is caused by using the wrong version of pip, a version >=9?

Regards
schwaben


#18

This sounds like a wrong pathlib version.

I have (in the NRP platform_venv):

  • pip 9.0.3
  • python 2.7.15+
  • pathlib2 2.3.5
  • netifaces 0.8
    In the system (apt packages), I have:
  • pathlib 1.0.1
  • pathlib2 2.3.0
  • netifaces 0.10.4

When you run the NRP, platform_venv packages should override system packages. But to get them installed in platform_venv, the system packages should be hidden, that’s why I suggested to make devinstall from the platform_venv.


#19

Hi, I would also try

source $HOME/.opt/platform_venv/bin/activate
pip install netifaces==0.8
deactivate

and then retriger the installation. Hope it helps!

Best,
Manos


#20

Hi,

I installed netifaces 0.8 om the platform_venv.
If I don’t install pathlib in the platform_venv, I still get this error running make devinstall in the platform_venv
ImportError: No module named pathlib
If I install pathlib, I get

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-2XKUuH/tzlocal/setup.py", line 8, in <module>
        + Path('CHANGES.txt').read_text('utf-8'))
AttributeError: 'PosixPath' object has no attribute 'read_text'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2XKUuH/tzlocal/

#21

Hi,

It’s like your system pythonpath was not accessible, weird. Your pathlib system location is /usr/lib/python2.7/dist-packages I guess. Check that please. If you uninstalled system pathlib, reinstall it using apt-get.
Then try adding its location path explicitely in your PYTHONPATH after activating the platform_venv and run make devinstall.

Hope this helps
Axel


#22

My system pathlib is installed. It’s location is /usr/lib/python2.7/dist-packages.
I added /usr/lib/python2.7/dist-packages to the PYTHONPATH after activating the platform_venv. Now I get this error when running make devinstall in the platform_venv

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-2PBrtW/opencv-python/setup.py”, line 9, in
import skbuild
> ImportError: No module named skbuild

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2PBrtW/opencv-python/

I tried the fix mentioned in this post ([SOLVED] Error after fresh install from source), removing open_cv from requirements.txt and
sudo ln /usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so ~/.opt/platform_venv/lib/python2.7/site-packages/
but then I get
> Complete output from command python setup.py egg_info:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-SFPM6e/tzlocal/setup.py", line 8, in <module>
        + Path('CHANGES.txt').read_text('utf-8'))
    AttributeError: 'PosixPath' object has no attribute 'read_text'
   
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SFPM6e/tzlocal/

I ran

./configure_nrp
./update_nrp build all
./configure_nrpPreformatted text

but get

ImportError: No module named pathlib
The build doesn’t fail, though.
When start the NRP, I can clone experiments, but when I try to launch them it tells me “No server can handle your simulation at the moment. Please try again later”Preformatted text


#23

Dear Schwaben,

Ok, I’ll pass to the developer team, they might have other insights. Btw, are you a developer? Do you need absolutely the source installation or could you consider installing over docker in Ubuntu?
https://neurorobotics.net/local_install.html
Axel


#24

Dear Axel,

Thank you for your help. I am not a developer. I am working with the docker installation now, so I don’t absolutely need the source installation.

Regards
schwaben


#25

Dear Schwaben,

Then I would advise you going for the docker installation as mentioned, because there is something broken in your Python, which is difficult to figure out remotely.

Bets regards
Axel