wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
531 stars 76 forks source link

plyvel does not work with jupyter notebook #113

Closed bwanaaa closed 4 years ago

bwanaaa commented 4 years ago

Entering conda list

# packages in environment at /home/stefan/anaconda3/envs/TF:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_tflow_select             2.1.0                       gpu  
absl-py                   0.9.0                    py37_0  
asn1crypto                1.3.0                    py37_0  
astor                     0.8.0                    py37_0  
blas                      1.0                         mkl  
blinker                   1.4                      py37_0  
c-ares                    1.15.0            h7b6447c_1001  
ca-certificates           2020.1.1                      0  
cachetools                3.1.1                      py_0  
certifi                   2019.11.28               py37_0  
cffi                      1.14.0           py37h2e261b9_0  
chardet                   3.0.4                 py37_1003  
click                     7.0                      py37_0  
cryptography              2.8              py37h1ba5d50_0  
cudatoolkit               10.1.243             h6bb024c_0  
cudnn                     7.6.5                cuda10.1_0  
cupti                     10.1.168                      0  
gast                      0.2.2                    py37_0  
google-auth               1.11.2                     py_0  
google-auth-oauthlib      0.4.1                      py_2  
google-pasta              0.1.8                      py_0  
grpcio                    1.27.2           py37hf8bcb03_0  
h5py                      2.10.0           py37h7918eee_0  
hdf5                      1.10.4               hb1b8bf9_0  
idna                      2.8                      py37_0  
intel-openmp              2020.0                      166  
keras-applications        1.0.8                      py_0  
keras-preprocessing       1.1.0                      py_1  
ld_impl_linux-64          2.33.1               h53a641e_7  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libprotobuf               3.11.4               hd408876_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
markdown                  3.1.1                    py37_0  
mkl                       2020.0                      166  
mkl-service               2.3.0            py37he904b0f_0  
mkl_fft                   1.0.15           py37ha843d7b_0  
mkl_random                1.1.0            py37hd6b4f25_0  
ncurses                   6.2                  he6710b0_0  
numpy                     1.18.1           py37h4f9e942_0  
numpy-base                1.18.1           py37hde5b4d6_1  
oauthlib                  3.1.0                      py_0  
openssl                   1.1.1d               h7b6447c_4  
opt_einsum                3.1.0                      py_0  
pip                       20.0.2                   py37_1  
plyvel                    1.2.0                    pypi_0    pypi
protobuf                  3.11.4           py37he6710b0_0  
pyasn1                    0.4.8                      py_0  
pyasn1-modules            0.2.7                      py_0  
pycparser                 2.19                     py37_0  
pyjwt                     1.7.1                    py37_0  
pyopenssl                 19.1.0                   py37_0  
pysocks                   1.7.1                    py37_0  
python                    3.7.6                h0371630_2  
readline                  7.0                  h7b6447c_5  
requests                  2.23.0                   py37_0  
requests-oauthlib         1.3.0                      py_0  
rsa                       4.0                        py_0  
scipy                     1.4.1            py37h0b6359f_0  
setuptools                46.0.0                   py37_0  
six                       1.14.0                   py37_0  
sqlite                    3.31.1               h7b6447c_0  
tensorboard               2.1.0                     py3_0  
tensorflow                2.1.0           gpu_py37h7a4bb67_0  
tensorflow-base           2.1.0           gpu_py37h6c5654b_0  
tensorflow-estimator      2.1.0              pyhd54b08b_0  
tensorflow-gpu            2.1.0                h0d30ee6_0  
termcolor                 1.1.0                    py37_1  
tk                        8.6.8                hbc83047_0  
urllib3                   1.25.8                   py37_0  
werkzeug                  1.0.0                      py_0  
wheel                     0.34.2                   py37_0  
wrapt                     1.11.2           py37h7b6447c_0  
xz                        5.2.4                h14c3975_4  
zlib                      1.2.11               h7b6447c_3  

shows that plyvel 1.2 is installed. Starting an interactive python session shows plyvel is there

python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import plyvel
>>> 

but trying to do this in a jupyter cell fails

`import plyvel`
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-c94f9712ac29> in <module>()
----> 1 import plyvel

ModuleNotFoundError: No module named 'plyvel'

How to fix this??

bwanaaa commented 4 years ago

BTW,plyvel is installed in the right place

(base) stefan@4930:~/Dropbox/aPython$ sudo find / -name plyvel
[sudo] password for stefan: 
find: ‘/run/user/1000/gvfs’: Permission denied
/home/stefan/anaconda3/envs/TF/lib/python3.7/site-packages/plyvel
(base) stefan@4930:~/Dropbox/aPython$ conda activate TF
(TF) stefan@4930:~/Dropbox/aPython$ which python
/home/stefan/anaconda3/envs/TF/bin/python
(TF) stefan@4930:~/Dropbox/aPython$ which pip
/home/stefan/anaconda3/envs/TF/bin/pip
bwanaaa commented 4 years ago

OOPS. jupyter was referencing the wrong python. conda install jupyter executed from within the environment fixed the problem.

wbolster commented 4 years ago

glad you solved it yourself 👍