简体   繁体   English

如何导入PyCharm中的程序包管理器中不可用的python项目

[英]How do I import a python project that is not available in package manager in PyCharm

I have created a simple python project in PyCharm. 我在PyCharm中创建了一个简单的python项目。 It only has one python file as of now. 到目前为止,它只有一个python文件。 I'd like to import this github project in my newly created python project so that I can reference some of its libraries and add something in my python file. 我想在新创建的python项目中导入 github项目,以便我可以引用其某些库并在python文件中添加一些内容。 How do I do this in PyCharm ? 如何在PyCharm做到这一点? I tried to go to Python Interpreter and adding this github project after cloning it but it didn't work. 我试图去Python Interpreter并在克隆它后添加这个github项目,但是没有用。

This is what I did 这就是我所做的

  1. I used terminal to go to the cloned project from github. 我使用终端去了从github cloned项目。
  2. This folder had a setup.py . 这个文件夹有一个setup.py
  3. I then did python3 setup.py install 然后我做了python3 setup.py安装
  4. It then installed it to my site-packages folder where my python3 installation was 然后将其安装到我的python3安装所在的我的site-packages文件夹中
  5. Then I opened Pycharm and clicked on Preferences >> Python Interpreter then in the list I saw the installed github project 然后我打开Pycharm ,然后单击Preferences >> Python Interpreter然后在列表中看到已安装的github项目

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

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