0

I installed the 'xsel' package via a downloaded .whl file. (I am not connected to the internal network that the package is from). I can see the package when I list all the packages (working from virtual environment). When I try to run a script that imports the xsel package I get the ModuleNotFoundError.

(.venv) PS C:\git\oct-fds> py -m pip install C:\Users\OCT\Documents\OCT2_development\Python_scipts\xsel-4.0.0-py3-none-any.whl  
Processing c:\users\oct\documents\oct2_development\python_scipts\xsel-4.0.0-py3-none-any.whl
Requirement already satisfied: numpy in c:\git\oct-fds\.venv\lib\site-packages (from xsel==4.0.0) (1.24.2)
Requirement already satisfied: pyserial in c:\git\oct-fds\.venv\lib\site-packages (from xsel==4.0.0) (3.5)
(.venv) PS C:\git\oct-fds> pip list
Package            Version   Editable project location
------------------ --------- -------------------------
certifi            2022.12.7
charset-normalizer 3.0.1
contourpy          1.0.7
cycler             0.11.0
fonttools          4.38.0
idna               3.4
kiwisolver         1.4.4
matplotlib         3.7.0
numpy              1.24.2
oct                0.0.1     C:\git\oct-fds
packaging          23.0
pandas             1.5.3
Pillow             9.4.0
pip                23.0.1
pyparsing          3.0.9
pyserial           3.5
python-dateutil    2.8.2
pytz               2022.7.1
setuptools         63.2.0
six                1.16.0
urllib3            1.26.14
xsel               4.0.0
(.venv) PS C:\git\oct-fds>  c:; cd 'c:\git\oct-fds'; & 'c:\git\oct-fds\.venv\Scripts\python.exe' 'c:\Users\OCT\.vscode\extensions\ms-python.python-2023.4.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '51308' '--' 'C:\git\oct-fds\oct\robot.py'

What am I doing wrong?

I tried installing it using the setup.tools install_requires= [ ..., "xsel" , ...]:

pip install -e . --find-links=C:\Users\OCT\Documents\OCT2_development\Python_scipts

This worked and I could see the package in pip list

I also tried uninstalling it and then installing it with the path of the file:

pip install C:\Users\OCT\Documents\OCT2_development\Python_scipts\xsel-4.0.0-py3-none-any.whl

Also seems to work, both with both I get the module.

With pip show I see the following:

(.venv) PS C:\git\oct-fds> pip show xsel       
Name: xsel
Version: 4.0.0
Summary: UNKNOWN
Home-page: https://github.com/philips-internal/
Author: Philips
Author-email:
License: UNKNOWN
Location: c:\git\oct-fds\.venv\lib\site-packages
Requires: numpy, pyserial
Required-by: oct

  • If you run on the command line (while in the venv) `python -c "import xsel"`, what error do you get? – Saaru Lindestøkke Mar 02 '23 at 12:56
  • I get:(.venv) PS C:\git\oct-fds> python -c "import xsel" Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'xsel' – Laurah Kuik Mar 02 '23 at 12:58
  • It's hard to provide any solutions as it's a proprietary package and nobody can reproduce this on their machine. If you go to the folder where `xsel` says it is installed, do you see the package there? Have [you tried](https://stackoverflow.com/a/53311583/1256347) adding that location directly to your path? – Saaru Lindestøkke Mar 02 '23 at 13:29
  • I went to the folder 'c:\git\oct-fds\.venv\lib\site-packages', there I could only find a folder called "xsel-4.0.0.dist-info" which did not contain any .py files. So then it could be a problem with the .whl file? – Laurah Kuik Mar 02 '23 at 13:42
  • I downloaded the package on the pc that did have connection to the internal network with: `pip download xsel --index-url=` – Laurah Kuik Mar 02 '23 at 13:48
  • You can [inspect the `.whl` file](https://stackoverflow.com/a/32924572/1256347) to see what's in it. [This question comes up](https://stackoverflow.com/q/50585246/1256347) if you search for "pip install wheel only install dist info no script", perhaps you can try out the steps listed there. – Saaru Lindestøkke Mar 02 '23 at 13:53

0 Answers0