开发者

Using a symlinked module on Windows with Python

开发者 https://www.devze.com 2023-03-23 13:02 出处:网络
Currently I\'ve got a symlinked directory of a python module I want in the same directory as my file, however when my python script tries to import pyamf python raises an ImportError: No module named

Currently I've got a symlinked directory of a python module I want in the same directory as my file, however when my python script tries to import pyamf python raises an ImportError: No module named pyamf.

When copying the directory it works fine, so it's something to do with the symlink (which was created with windows' mklink command rather than msys ln)

Python is vers开发者_JAVA百科ion 2.7.2 x64


Python 2.7 has problems with Windows symlinks. Instead of making a sym-link, make a directory junction using the \J option. For example:

mklink \J link_dir target_dir
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号