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

Installation problems on Linux (Ubuntu 23.04) #155

Open
ryszard314159 opened this issue Sep 15, 2023 · 13 comments
Open

Installation problems on Linux (Ubuntu 23.04) #155

ryszard314159 opened this issue Sep 15, 2023 · 13 comments

Comments

@ryszard314159
Copy link

I completed installation process as described in docs but I am getting an error ModuleNotFoundError: No module named 'plyvel'
I guess I am missing something, but I do not know what. I would appreciate some guidance.

$ virtualenv ~/.virtualenvs/plyvel
(plyvel) $ pip install plyvel
Collecting plyvel
  Using cached plyvel-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (803 kB)
Installing collected packages: plyvel
Successfully installed plyvel-1.5.0
(plyvel) $ 
(plyvel) $ python -c 'import plyvel'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'plyvel'
(plyvel) $
(plyvel) $ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.04
Release:	23.04
Codename:	lunar
(plyvel) $ 
@wbolster
Copy link
Owner

seems you're doing the right thing 🤔

some ideas (typing from phone, didn't try myself):

  • try pip install --verbose plyvel to see more details
  • try browsing the venv directory. it should contain a site-packages directory with plyvel inside. do you see that?

@ryszard314159
Copy link
Author

Yes, it does.

(plyvel) $ pip install --verbose plyvel
Using pip 23.0.1 from /home/ryszard/.virtualenvs/plyvel/lib/python3.11/site-packages/pip (python 3.11)
Requirement already satisfied: plyvel in ./lib/python3.11/site-packages (1.5.0)
(plyvel) $

and

(plyvel) $ ls ./
bin  lib  plyvel  pyvenv.cfg
(plyvel) $
(plyvel) $ find ./ | grep "site-packages/plyvel" | head
./lib/python3.11/site-packages/plyvel.libs
./lib/python3.11/site-packages/plyvel.libs/libsnappy-2c75d721.so.1.1.9
./lib/python3.11/site-packages/plyvel.libs/libleveldb-e43d8649.so.1.22.0
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/RECORD
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/top_level.txt
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/WHEEL
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/REQUESTED
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/LICENSE.rst
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/INSTALLER
(plyvel) $ 

@wbolster
Copy link
Owner

there should also be a .so file for plyvel itself (not just the dependencies), but your output is truncated

can you try installing without pip wheel cache? it's a cmdline flag but i forgot the name – try --help. i see ‘using cached …’ and want to rule that out.

@ryszard314159
Copy link
Author

Full log for the fresh install without cache (ModuleNotFoundError: No module named 'plyvel' still persist)

$ virtualenv ~/.virtualenvs/fresh
created virtual environment CPython3.11.4.final.0-64 in 134ms
  creator CPython3Posix(dest=/home/ryszard/.virtualenvs/fresh, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/ryszard/.local/share/virtualenv)
    added seed packages: pip==23.0.1, setuptools==66.1.1, wheel==0.38.4
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
$ cd ~/.virtualenvs/fresh
$ source bin/activate
(fresh) $ pip install --verbose plyvel --no-cache-dir
Using pip 23.0.1 from /home/ryszard/.virtualenvs/fresh/lib/python3.11/site-packages/pip (python 3.11)
Collecting plyvel
  Downloading plyvel-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (803 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 803.4/803.4 kB 10.5 MB/s eta 0:00:00
Installing collected packages: plyvel
Successfully installed plyvel-1.5.0
(fresh) $ python -c "import plyvel"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'plyvel'
(fresh) $ find ./ | grep "site-packages/plyvel" 
./lib/python3.11/site-packages/plyvel.libs
./lib/python3.11/site-packages/plyvel.libs/libsnappy-2c75d721.so.1.1.9
./lib/python3.11/site-packages/plyvel.libs/libleveldb-e43d8649.so.1.22.0
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/RECORD
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/top_level.txt
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/WHEEL
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/REQUESTED
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/LICENSE.rst
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/INSTALLER
./lib/python3.11/site-packages/plyvel-1.5.0.dist-info/METADATA
./lib/python3.11/site-packages/plyvel
./lib/python3.11/site-packages/plyvel/_plyvel.cpython-311-x86_64-linux-gnu.so
./lib/python3.11/site-packages/plyvel/__init__.py
./lib/python3.11/site-packages/plyvel/__pycache__
./lib/python3.11/site-packages/plyvel/__pycache__/_version.cpython-311.pyc
./lib/python3.11/site-packages/plyvel/__pycache__/__init__.cpython-311.pyc
./lib/python3.11/site-packages/plyvel/_version.py
(fresh) $ 

@wbolster
Copy link
Owner

weird, this all looks perfectly normal to me

csn you try

  • which python
  • python --version
  • python, then import sys; print(sys.path)

@ryszard314159
Copy link
Author

ryszard314159 commented Sep 15, 2023

(fresh) $ which python
/home/ryszard/.virtualenvs/fresh/bin/python
(fresh) $ python --version
Python 3.11.4
(fresh) $ python -c "import sys; print(sys.path)"
['', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.11/dist-packages']
(fresh) $ 
(fresh) $ ls -lt bin/python
lrwxrwxrwx 1 ryszard ryszard 16 Sep 15 14:50 bin/python -> /usr/bin/python3
(fresh) $ 

@wbolster
Copy link
Owner

wbolster commented Sep 15, 2023

weird, i expected to see the venv in the import path (sys.path) but it seems missing? 😕

can you try with another library? e.g. pip install jsonlines (pure python, no depencies)

can you try not using virtualenv, but the built-in venv module? python -m venv somedir etc.

@ryszard314159
Copy link
Author

weird, i expected to see the venv in the import path (sys.path) but it seems missing?

Yes, apparently.

This works:

(fresh) $ export PYTHONPATH=$PWD/lib/python3.11/site-packages
(fresh) $ python -c "import plyvel"
(fresh) $

@wbolster
Copy link
Owner

cool, that's progress.

does it happen with venv (not virtualenv) as well?

(virtualenv mentioned in the docs is a leftover from the python 2.x era. stdlib venv mostly suffices these days)

@ryszard314159
Copy link
Author

ryszard314159 commented Sep 15, 2023

Apparently the same problem with python3 -m venv
sys.path is not updated properly...

$ python3 -m venv VENV
$ cd VENV/
$ ls
bin  include  lib  lib64  pyvenv.cfg
$ source bin/activate
(VENV) $ pip install plyvel
Collecting plyvel
  Using cached plyvel-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (803 kB)
Installing collected packages: plyvel
Successfully installed plyvel-1.5.0
(VENV) $ python -c "import plyvel"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'plyvel'
(VENV) $
(VENV) $ python -c "import sys; print(sys.path)"
['', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.11/dist-packages']
(VENV) $

@ryszard314159
Copy link
Author

Does it work for you? Is it something peculiar to my setup?

@ryszard314159
Copy link
Author

Thank you for this nice and useful app!

@wbolster
Copy link
Owner

i just tried myself, and it works fine for me. i suspect this has something to do with your setup (or with ubuntu packaging). can you try a few more things using fresh directories etc:

before creating a venv:

  • which python
  • which python3

after creating a venv and activating it:

  • which python
  • which python3
  • echo "$PATH"
  • python -c "import sys; print(sys.path)"

and please do the above with both virtualenv and built-in venv

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