简体   繁体   English

从/ usr / local将库导入PyCharm

[英]Import library from /usr/local to PyCharm

I have installed OpenCV and make a python virtual environment adding a simbolink link to OpenCV library in /usr/local/lib/python3.6/sites-packages/cv2.so This is working fine (in Spyder I only change the default interpreter by the interpreter in the virtual environment and the library is loaded). 我已经安装了OpenCV并制作了一个python虚拟环境,将一个simbolink链接添加到/usr/local/lib/python3.6/sites-packages/cv2.so中的OpenCV库。虚拟环境中的解释器并加载了库)。 But when I do the same thing in PyCharm, it seems like the simbolink link is broken because PyCharm can't acces to /usr/local... path ( Screenshot ). 但是,当我做同样的事情在PyCharm,它好像simbolink链接被打破,因为PyCharm不能ACCES到/ usr /本地...路径( 截图 )。

Thanks for your time. 谢谢你的时间。

In PyCharm, you can go to the settings from the file menu. 在PyCharm中,您可以从文件菜单转到设置。 Under the project settings, go to the project interpreter. 在项目设置下,转到项目解释器。 Choose the project interpreter you want from the list of options. 从选项列表中选择所需的项目解释器。 From the list you can see the modules loaded for the interpreter in the virtual environment. 从列表中,您可以看到在虚拟环境中为解释器加载的模块。 If you find any library missing, you can just add them by searching for the name. 如果发现缺少任何库,则可以通过搜索名称来添加它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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