2011-03-02 3 views

답변

0

설정> 파이썬 인터프리터에서 프로젝트에 맞는 Python 설치를 선택하셨습니까?

+0

예. 나는 2.7을 사용하고있다. –

1

이것은 이상적인 해결책이 아니지만 작동하며 상사에게 호의를 보입니다.

모든 기존 코드 앞에 pycharm의 django_manage.py를 수정하고 상단에 다음 코드를 삽입하십시오. django_manage.py는 [PyCharm install directory] /helpers/pycharm/django_manage.py에서 찾을 수 있습니다.

import site 
import sys 

# Add the locations missing from PYTHONPATH when running a manage.py task here. 
ALLDIRS = [ 
    r'C:\git_repos\src\dev\common\py', 
    r'C:\git_repos\src\dev\main_website', 
] 

# Remember original sys.path. 

prev_sys_path = list(sys.path) 

# Add each new site-packages directory. 

for directory in ALLDIRS: 
    site.addsitedir(directory) 

# Reorder sys.path so new directories at the front. 

new_sys_path = [] 
for item in list(sys.path): 
    if item not in prev_sys_path: 
     new_sys_path.append(item) 
     sys.path.remove(item) 
sys.path[:0] = new_sys_path 
+0

감사합니다. Wogan! 훨씬 낫다. –

관련 문제