Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1641 Discussions

python pip install error

W_E_Intel
Employee
2,557 Views

Dear Devcloud admin and support

when I install any user python package i got the following error, you can use the following command to reproduce the error :

 

python3 -m pip install tqdm --user

 


Traceback (most recent call last):
  File "/glob/intel-python/python3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/glob/intel-python/python3/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/glob/intel-python/python3/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>
    from pip._vendor import pkg_resources
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>
    @_call_aside
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside
    f(*args, **kwargs)
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set
    dist.activate(replace=False)
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate
    declare_namespace(pkg)
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns
    _rebuild_mod_path(path, packageName, module)
  File "/glob/intel-python/python3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path
    orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'

 

thank you,

W

0 Kudos
6 Replies
AthiraM_Intel
Moderator
2,542 Views

Hi,


Thanks for reaching out to us.


Could you please try installing the package after creating a conda environment.


Please follow the below steps:


1. Create a conda environment:

conda create -n env_name python=3.6

2. Activate the environment:

source activate env_name

3. Install the package:

python3 -m pip install tqdm --user

If the issue still persists please let us know.


Thanks



0 Kudos
W_E_Intel
Employee
2,535 Views

hello AThiraM,

I tried your steps but received same error, Is there any solution without using conda ?

thank you, I appreciate your help!

regards,

W

0 Kudos
AthiraM_Intel
Moderator
2,515 Views

Hi,


You can activate the oneAPI environment before installing the package.

Please find the below command to activate the oneAPI environment:

source /opt/intel/inteloneapi/setvars.sh


Please make sure that the python used is "/glob/development-tools/versions/oneapi/beta09/inteloneapi/intelpython/latest/bin/python" using "which python" command.


Also you can try to install the tqdm package using conda:

conda install -c conda-forge tqdm


If the issue still persists please share your user id and give us the permission to access your DevCloud account. We will inform the concerned team.


Thanks.



0 Kudos
AthiraM_Intel
Moderator
2,490 Views

Hi,


Could you please give us an update? Is your issue resolved?


Thanks.


0 Kudos
AthiraM_Intel
Moderator
2,465 Views

Hi,


We have not heard back from you, we wont be monitoring this thread. If you need further assistance, please post a new thread.


Thanks.


0 Kudos
W_E_Intel
Employee
2,344 Views

Hello Athira,

the system still report the same error.

I found there are some solutions for the same problem on the following links :

https://stackoverflow.com/questions/47955397/pip3-error-namespacepath-object-has-no-attribute-sort

https://github.com/googleapis/google-cloud-python/issues/2990

I don't have privilege to the system to try these solutions 

 

thank you for your help and support.

 

0 Kudos
Reply