I have an dir A which contain some py files. I want use pycharm to debug those python files. However, I can not create pycharm project on A dir because A is a subdir in version control. So I create the project into another place like B. Then I need import files under A to this new created project.
I google this find it can be done by add content root, after I do this, I can see those files in project, however the added path is not subdir of the created root path. When I run the py file, it report an error:
IOError: [Errno 2] No such file or directory: 'PathA/xx.py'
How to do this? I use pycharm community 2018.2. The created project use venv
I remember fore version can import files from other location. This newest version can not do this. The only way is create the project in the directory which hold by version control tool. However, pycharm only will create 2 directories which are .idea
and venv
. Just let version control tool to ignore them.