Search code examples
python-3.xsymlinkjunction

is there a way to combine the content of two directories in Windows


Having two folders (from the project repo): C:\code\Python-Scripts\src C:\code\Python-Library\src

How can they be combined in order that import packages to work like it suppose to?

NOTE: Both directories contain the same sub-dirs but there are some utility libraries in the Python-Library. It looks to me that they are so organized in order to group the functionality. After the project build they are actually combined.

NOTE 2: I tried to create some dir symlink called src inside Python-Scripts to target C:\code\Python-Library\src but mklink fails because there is already a src dir.

cd /d C:\code\Python-Scripts\src
mklink /D src C:\code\Python-Library\src
Cannot create a file when that file already exists.

Can anyone have other ideas rather than simply copy C:\code\Python-Library\src to C:\code\Python-Scripts\src ?

It would also help to write the scripts in PyDev in order that the import packages to correctly resolved.


Solution

  • Well.. it passed 22 hours and no answer showed up. The answer seems to be you cannot combine or join or put together directories. However, one can set the PYTHONPATH to dir1;dir2 and PyDev finds them. Have a good day!