简体   繁体   中英

pyenv using right python version but using wrong libraries folder

Hello I currently run on 3.8 python. I need to execute a 3.6 version script that uses the Crypto and time libraries. So I installed pyenv and pyenv-virtualenv. I installed the version of python I wanted : pyenv install 3.6.8 . Then I went to my project folder cd Documents/CSC/myProject/ . I executed : pyenv local 3.6.8 . I verified the pip version : pip 18.1 from /home/alex/.pyenv/versions/3.6.8/lib/python3.6/site-packages/pip (python 3.6) . That was okay. Then I installed Crypto on the 3.6 version. But when I run the script I have the following error: File "/usr/lib/python3.8/site-packages/Crypto/Random/_UserFriendlyRNG.py", line 77, in collect t = time.clock() AttributeError: module 'time' has no attribute 'clock' Why does python search the 3.8 version of Crypto even if I have the 3.6 version on local. When I am in the folder the 3.6 version ? I'm a bit confused. Thanks for your help :)

Not sure whats causing the problem but i would suggest you to pipenv instead. It is more reliable and simpler in my personal opinion You can install it using pip install pipenv and then do pipenv shell to use it. Read more about it here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM