NRP build all error: from pip.locations import ImportError: cannot import name bin_user


#1

Hi everyone!

I have been unsuccessfully trying to update the platform. Now I am just trying to fix the issue which is related with pip.

Stackoverflow is not being very useful in this matter so maybe someone here could help me out

The error I get it in different points of the building: experimentcontrol, brainsimulation, virtualcoach, cle, exdbackend, experiments,…

from pip.locations import (
ImportError: cannot import name bin_user
EXPERIMENTS: PIP INSTALL ERROR

I tried to upgrade pip, also to remove it and install it using apt-get as proposed in the documentation. But nothing seems to be working. The current version of pip is 8.1.1.

Any suggestions?

Kind regards,

Carlos


#2

Dear Carlos,

Let’s narrow our search to a simple instance. What do you get if your run the following commands?

virtualenv /tmp/test_env
source /tmp/test_env/bin/activate
pip install pillow==5.0.0
deactivate

Best regards,
Luc


#3

Hi Luc,

Thanks for your answer. This is what I get:

**virtualenv /tmp/test_env**

Running virtualenv with interpreter /usr/bin/python2
New python executable in /tmp/test_env/bin/python2
Also creating executable in /tmp/test_env/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.

**pip install pillow==5.0.0**

Collecting pillow==5.0.0
  Downloading https://files.pythonhosted.org/packages/89/bd/1d9a10f3e8157b7df275740b0782a892a0db387f8286620110c41e5146c7/Pillow-5.0.0-cp27-cp27mu-manylinux1_x86_64.whl (5.8MB)
    100% |████████████████████████████████| 5.9MB 5.9MB/s 
hbp-nrp-cleserver 1.3.8 requires defusedxml==0.5.0, which is not installed.
hbp-nrp-cleserver 1.3.8 requires Jinja2==2.7.1, which is not installed.
hbp-nrp-cleserver 1.3.8 requires pyxb==1.2.4, which is not installed.
hbp-nrp-cle 1.3.9 requires catkin_pkg==0.2.10, which is not installed.
hbp-nrp-cle 1.3.9 requires cython==0.23.4, which is not installed.
hbp-nrp-cle 1.3.9 requires futures==3.0.3, which is not installed.
hbp-nrp-cle 1.3.9 requires h5py==2.6.0, which is not installed.
hbp-nrp-cle 1.3.9 requires lazyarray==0.2.9, which is not installed.
hbp-nrp-cle 1.3.9 requires lxml==3.4.0, which is not installed.
hbp-nrp-cle 1.3.9 requires mock==1.0.1, which is not installed.
hbp-nrp-cle 1.3.9 requires mpi4py==2.0.0, which is not installed.
hbp-nrp-cle 1.3.9 requires neo==0.4.0, which is not installed.
hbp-nrp-cle 1.3.9 requires netifaces==0.8, which is not installed.
hbp-nrp-cle 1.3.9 requires numpy==1.11.0, which is not installed.
hbp-nrp-cle 1.3.9 requires pexpect==3.1, which is not installed.
hbp-nrp-cle 1.3.9 requires progressbar2==3.34.0, which is not installed.
hbp-nrp-cle 1.3.9 requires psutil==2.0.0, which is not installed.
hbp-nrp-cle 1.3.9 requires PyNN==0.9.1, which is not installed.
hbp-nrp-cle 1.3.9 requires pyxb==1.2.4, which is not installed.
hbp-nrp-cle 1.3.9 requires PyYAML==3.11, which is not installed.
hbp-nrp-cle 1.3.9 requires RestrictedPython==3.6.0, which is not installed.
hbp-nrp-cle 1.3.9 requires rospkg==1.0.38, which is not installed.
hbp-nrp-cle 1.3.9 requires scipy==0.17.1, which is not installed.
hbp-nrp-cle 1.3.9 requires testfixtures==3.0.2, which is not installed.
hbp-nrp-commons 1.3.8 requires catkin_pkg==0.2.10, which is not installed.
hbp-nrp-commons 1.3.8 requires mock==1.0.1, which is not installed.
hbp-nrp-commons 1.3.8 requires pexpect==3.1, which is not installed.
hbp-nrp-commons 1.3.8 requires pyxb==1.2.4, which is not installed.
hbp-nrp-commons 1.3.8 requires PyYAML==3.11, which is not installed.
hbp-nrp-commons 1.3.8 requires rospkg==1.0.38, which is not installed.
hbp-nrp-commons 1.3.8 requires transitions==0.4.0, which is not installed.
hbp-nrp-distributed-nest 1.3.8 requires mpi4py==2.0.0, which is not installed.
hbp-nrp-excontrol 1.3.9 requires catkin_pkg==0.2.10, which is not installed.
hbp-nrp-excontrol 1.3.9 requires numpy==1.11.0, which is not installed.
hbp-nrp-excontrol 1.3.9 requires pyxb==1.2.4, which is not installed.
hbp-nrp-excontrol 1.3.9 requires PyYAML==3.11, which is not installed.
hbp-nrp-excontrol 1.3.9 requires RestrictedPython==3.6.0, which is not installed.
hbp-nrp-excontrol 1.3.9 requires rospkg==1.0.38, which is not installed.
hbp-nrp-backend 1.3.8 requires catkin_pkg==0.2.10, which is not installed.
hbp-nrp-backend 1.3.8 requires cryptography==1.9, which is not installed.
hbp-nrp-backend 1.3.8 requires Flask-Migrate==1.6.0, which is not installed.
hbp-nrp-backend 1.3.8 requires Flask-Script==2.0.5, which is not installed.
hbp-nrp-backend 1.3.8 requires lxml==3.4.0, which is not installed.
hbp-nrp-backend 1.3.8 requires psycopg2==2.6.1, which is not installed.
hbp-nrp-backend 1.3.8 requires pyxb==1.2.4, which is not installed.
hbp-nrp-backend 1.3.8 requires PyYAML==3.11, which is not installed.
hbp-nrp-backend 1.3.8 requires requests, which is not installed.
hbp-nrp-backend 1.3.8 requires rospkg==1.0.38, which is not installed.
hbp-nrp-backend 1.3.8 requires timeout-decorator==0.3.2, which is not installed.
hbp-nrp-backend 1.3.8 requires urllib3[secure]==1.21.1, which is not installed.
hbp-nrp-music-xml 1.3.8 requires configparser==3.5.0, which is not installed.
hbp-nrp-music-xml 1.3.8 requires prettytable==0.7.2, which is not installed.
hbp-nrp-music-xml 1.3.8 requires pyxb==1.2.4, which is not installed.
hbp-nrp-music-interface 1.3.8 requires mpi4py==2.0.0, which is not installed.
hbp-nrp-music-interface 1.3.8 requires netifaces==0.8, which is not installed.
hbp-nrp-watchdog 1.3.8 requires catkin_pkg==0.2.10, which is not installed.
hbp-nrp-watchdog 1.3.8 requires psutil==2.0.0, which is not installed.
hbp-nrp-watchdog 1.3.8 requires PyYAML==3.11, which is not installed.
hbp-nrp-watchdog 1.3.8 requires rospkg==1.0.38, which is not installed.
hbp-flask-restful-swagger 0.15.2 requires Flask-RESTful>=0.2.12, which is not installed.
hbp-nrp-virtual-coach 1.3.9 requires mock==1.0.1, which is not installed.
hbp-nrp-virtual-coach 1.3.9 requires progressbar2==3.34.0, which is not installed.
hbp-nrp-virtual-coach 1.3.9 requires texttable==0.8.7, which is not installed.
hbp-nrp-excontrol 1.3.9 has requirement tf==1.0.0, but you'll have tf 1.11.9 which is incompatible.
Installing collected packages: pillow
Successfully installed pillow-5.0.0

Kind regards,

Carlos


#4

This means that the problem is caused only by ~/.opt/platform_venv. Could you run the following commands and copy-paste the output?

source ~/.opt/platform_venv/bin/activate
pip install pillow==5.0.0
deactivate

Best regards,
Luc


#5

This command:
source ~/platform_venv/bin/activate

Returns this:

bash: /home/dtu-neurorobotics-desk2/platform_venv/bin/activate: No such file or directory

But I am not sure if you missed the .opt in the path

Kind regards,

Carlos


#6

Yes, I missed the ~/.opt/ prefix (corrected now).
Luc


#7

Thanks for your answer.

After running this:
source ~/.opt/platform_venv/bin/activate
pip install pillow==5.0.0

It returns:

Traceback (most recent call last):
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/bin/pip", line 7, in <module>
    from pip import main
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
    from pip.commands import commands, get_similar_commands, get_summaries
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/commands/__init__.py", line 6, in <module>
    from pip.commands.bundle import BundleCommand
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/commands/bundle.py", line 6, in <module>
    from pip.commands.install import InstallCommand
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 5, in <module>
    from pip.req import InstallRequirement, RequirementSet, parse_requirements
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/req/__init__.py", line 3, in <module>
    from .req_install import InstallRequirement
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 32, in <module>
    from pip.locations import (
ImportError: cannot import name bin_user

Kind regards,

Carlos


#8

After

source ~/.opt/platform_venv/bin/activate

could you run also

 python --version
 pip --version

and try

 pip install --upgrade pip==9.0.3
 pip install pillow==5.0.0

?
If upgrading pip fails, you may need to uninstall pip and re-install it it ~/.opt/platform_venv.


#9

python --version

2.7.12

pip --version

Traceback (most recent call last):
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/bin/pip", line 7, in <module>
    from pip import main
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
    from pip.commands import commands, get_similar_commands, get_summaries
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/commands/__init__.py", line 6, in <module>
    from pip.commands.bundle import BundleCommand
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/commands/bundle.py", line 6, in <module>
    from pip.commands.install import InstallCommand
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 5, in <module>
    from pip.req import InstallRequirement, RequirementSet, parse_requirements
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/req/__init__.py", line 3, in <module>
    from .req_install import InstallRequirement
  File "/home/dtu-neurorobotics-desk2/.opt/platform_venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 32, in <module>
    from pip.locations import (
ImportError: cannot import name bin_user

I tried to uninstall and re-install it but I always get the same error.

Kind regards,

Carlos


[SOLVED] Errors during build of fresh source install
#10

The installation of pip in your ~/.opt/platform_venv is broken. You could try this to create and populate platform_venv anew:

rm -r ~/.opt/platform_venv 
bash $HBP/user-scripts/update_nrp build all

Best regards,
Luc


#11

Hi Luc,

When doing the building, it reaches the ExDBackend step and this error rises:

Installing collected packages: hbp-nrp-backend, Jinja2
  Running setup.py develop for hbp-nrp-backend
    
    Creating /home/dtu-neurorobotics-desk2/Documents/NRP/ExDBackend/platform_venv/lib/python2.7/site-packages/hbp-nrp-backend.egg-link (link to .)
    Adding hbp-nrp-backend 2.0.2 to easy-install.pth file
    
    Installed /home/dtu-neurorobotics-desk2/Documents/NRP/ExDBackend/hbp_nrp_backend
  Found existing installation: Jinja2 2.7.1
    Uninstalling Jinja2:
      Successfully uninstalled Jinja2
  Running setup.py install for Jinja2
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    no previously-included directories found matching 'docs/_build'
      File "/home/dtu-neurorobotics-desk2/Documents/NRP/ExDBackend/platform_venv/lib/python2.7/site-packages/jinja2/asyncfilters.py", line 7
        async def auto_to_seq(value):
                ^
    SyntaxError: invalid syntax
    
      File "/home/dtu-neurorobotics-desk2/Documents/NRP/ExDBackend/platform_venv/lib/python2.7/site-packages/jinja2/asyncsupport.py", line 22
        async def concat_async(async_gen):
                ^
    SyntaxError: invalid syntax
    
Successfully installed hbp-nrp-backend Jinja2
Cleaning up...
mkdir: cannot create directory ‘/lib/python2.7’: Permission denied
cp: cannot create regular file '/lib/python2.7/site-packages/': No such file or directory
cp: cannot create regular file '/lib/python2.7/site-packages/': No such file or directory
ERROR

Kind regards,

Carlos


#12

It seems that the installation script tries to install ExDBackend dependencies in $HBP/ExDBackend/platform_venv and not in ~/.opt/platform_venv, which is the desired target in your case. Could you run the command

rm -rf $HBP/ExDBackend/platform_venv

then open a new terminal, check that

echo $NRP_VIRTUAL_ENV
echo $VIRTUAL_ENV

return the same value, namely ~/.opt/platform_venv and eventually run the update_nrp script again?


#13

Dear Luc,

This solved my issue. Thank you very much!
However I would like to say that my initial problem was building mvapich2. Following Mano’s suggestion I removed it from nrp_functions and that is what triggered the problem that you helped me to solve.
Now I have added mvapich2 again to the building step and proceeded with the ./update_nrp update all but I got this error in the mvapich2 step:

adio/common/ad_coll_exch_new.c: In function ‘ADIOI_Exch_file_views’:
adio/common/ad_coll_exch_new.c:509:1: internal compiler error: Segmentation fault
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
  CC       adio/common/ad_init.lo
Makefile:3317: recipe for target 'adio/common/ad_coll_exch_new.lo' failed
make[3]: *** [adio/common/ad_coll_exch_new.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/dtu-neurorobotics-desk2/Documents/NRP/mvapich2/src/mpi/romio'
Makefile:4168: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/dtu-neurorobotics-desk2/Documents/NRP/mvapich2/src/mpi/romio'
Makefile:43951: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/dtu-neurorobotics-desk2/Documents/NRP/mvapich2'
Makefile:11724: recipe for target 'all' failed
make: *** [all] Error 2
MVAPICH2 BUILD ERROR

Kind regards,

Carlos


#14

Hi again,

As a final remark, I proceeded with the update without including mvapich2 since I have been told that it is not needed to update it. After that, everything seems to be working fine.

Kind regards,

Carlos


#15

Hi Carlos,

It seems to be a problem with gcc, the C++ compiler used to build mvapich2.

Could you:

  • run the command gcc --version and copy the output in your reply;
  • run the command nproc and copy the output in your reply (maybe compilation is too demanding for your computer and we should lower the number of processes used during the build);
  • copy the full error message that you got, i.e., also the part above “Segmentation fault”?

Thanks in advance,
Luc