简体   繁体   中英

How to ignore .local/lib/python3.7/site-packages/ when importing a module to python script

I have tried importing pandas from local pkg , which has 1.1.12 version ,

But I have another path where it has lower version 1.0.1 ,

When i import pandas in python script , as a default it is picking up 1.1.12 version which i do't want to happen. I have tried removing that path from sys.remove.path('.local/lib/python3.7/site-packages/') as first line in my code , still it is picking the same one than 1.0.1 ?

any suggesting to only import modules/pkgs other than .local ones ?

To fix this why not try to do this in a virtual enviorment? as it will be forced to take your specific file only

Hope it helped! :D

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