2014-07-09 16 views
3

'가상 환경'에 Flask를 설치하려고합니다. 나는 virtualenv가 활성화되었을 때 pip 명령을 얻으려고 몇 가지 오류가있었습니다. (나의 사용자 이름이 이름에 공백이 있음을 알았습니다.) 마지막으로 해결책을 찾았습니다. 사용자 이름 폴더를 피하기 위해 pip가있는 곳에 올바른 경로를 입력하기 만하면됩니다.Flask - Python 설치 오류가 발생했습니다.

(venv) C:\Users\Daniel P-C>cd C:\Python34\Scripts 

(venv) C:\Python34\Scripts>pip 

Usage: 
     pip <command> [options] 
etc... 

잘 플라스크를 설치하려고 할 때 얻을 다음과 같은 오류가

(venv) C:\Python34\Scripts>pip install flask 
Downloading/unpacking flask 
    Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P 
-C\flask\setup.py) egg_info for package flask 

    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 
'examples' 
    no previously-included directories found matching 'docs\_build' 
    no previously-included directories found matching 'docs\_themes\.git' 
Downloading/unpacking Werkzeug>=0.7 (from flask) 
    Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P 
-C\Werkzeug\setup.py) egg_info for package Werkzeug 

    warning: no files found matching '*' under directory 'werkzeug\debug\templat 
es' 
    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 
'examples' 
    no previously-included directories found matching 'docs\_build' 
Downloading/unpacking Jinja2>=2.4 (from flask) 
    Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P 
-C\Jinja2\setup.py) egg_info for package Jinja2 

    warning: no files found matching '*' under directory 'custom_fixers' 
    warning: no previously-included files matching '*' found under directory 'do 
cs\_build' 
    warning: no previously-included files matching '*.pyc' found under directory 
'jinja2' 
    warning: no previously-included files matching '*.pyc' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 
'jinja2' 
    warning: no previously-included files matching '*.pyo' found under directory 
'docs' 
Downloading/unpacking itsdangerous>=0.21 (from flask) 
    Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P 
-C\itsdangerous\setup.py) egg_info for package itsdangerous 

    warning: no previously-included files matching '*' found under directory 'do 
cs\_build' 
Downloading/unpacking markupsafe (from Jinja2>=2.4->flask) 
    Downloading MarkupSafe-0.23.tar.gz 
    Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P 
-C\markupsafe\setup.py) egg_info for package markupsafe 

Installing collected packages: flask, Werkzeug, Jinja2, itsdangerous, markupsafe 

    Running setup.py install for flask 

    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 
'examples' 
    no previously-included directories found matching 'docs\_build' 
    no previously-included directories found matching 'docs\_themes\.git' 
    Running setup.py install for Werkzeug 

    warning: no files found matching '*' under directory 'werkzeug\debug\templat 
es' 
    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 
'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 
'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 
'examples' 
    no previously-included directories found matching 'docs\_build' 
    Running setup.py install for Jinja2 

    warning: no files found matching '*' under directory 'custom_fixers' 
    warning: no previously-included files matching '*' found under directory 'do 
cs\_build' 
    warning: no previously-included files matching '*.pyc' found under directory 
'jinja2' 
    warning: no previously-included files matching '*.pyc' found under directory 
'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 
'jinja2' 
    warning: no previously-included files matching '*.pyo' found under directory 
'docs' 
    Running setup.py install for itsdangerous 

    warning: no previously-included files matching '*' found under directory 'do 
cs\_build' 
    Running setup.py install for markupsafe 

    building 'markupsafe._speedups' extension 
    ========================================================================== 
    WARNING: The C extension could not be compiled, speedups are not enabled. 
    Failure information, if any, is above. 
    Retrying the build without the C extension now. 


    ========================================================================== 
    WARNING: The C extension could not be compiled, speedups are not enabled. 
    Plain-Python installation succeeded. 
    ========================================================================== 
Successfully installed flask Werkzeug Jinja2 itsdangerous markupsafe 
Cleaning up... 

이 성공적 플라스크에 설치되어 있다고하지만, 파이썬을 실행하고 외설처럼 수입은 그것이 플라스크를 입력하려고 할 때 ' 설치되어 있습니까? 내가 무엇을 할 수 있을지?

(venv) C:\Python34\Scripts>python 
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In 
tel)] on win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import flask 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named 'flask' 

나는 BTW 당신이 당신의 경로에 파이썬을 추가 했

+0

btw - 누락 된 파일에 대해 불평하는 경고는 괜찮습니다. 그들은 대부분 설치 패키지의 일부가 아닌 일부 파일을 포함하는'MANIFEST.in' 파일을 포함하는 설치 패키지의 결과입니다. 이것은 문서 (들) 디렉토리에서 자주 사용되는데, 여기서는 테스트와 다른 것들에 대해서도 마찬가지입니다. –

답변

2

하여주십시오, 당신은 모듈/패키지의 venv

에서 PIP와 파이썬을 사용하여이 VIRTUALENV에 pip으로 설치하려면 VIRTUALENV에서 pip를 사용해야합니다.

virtualenv 환경에 설치된 모듈/패키지를 가져 오려면 주어진 virtualenv에서 python 인터프리터를 실행해야합니다. 경우

, 당신은 디렉토리 C:\Python 34\Scripts에서 pip 또는 python, 그것은, 당신은 매우 가능성이 pip 다양한 시스템을 사용하고 시스템 파이썬에 flask 설치되어 실행합니다. 리눅스에서는 시스템 과이드 파이썬에 설치하는 것이 루트 권한이 필요합니다. MS 윈도우 기본 파이썬 설치에서는 불평하지 않습니다.

조언 : 기본 Python 설치 디렉토리에서 virtualenv를 만들고이 virtulaenv의 pippython을 사용하십시오. 이 python venv하고 pip 아무 해가되지 것입니다 명시 적 경로를 사용하여, 어쨌든 (보통은 VIRTUALENV를 활성화 할 때, 그래서 필요가 명시 적으로 pip 또는 python에 전체 경로를 사용하는 없다 일 것입니다.

+0

안녕하십니까. 1 월, 다음과 같은 해결책을 시도해 보았습니다. (오해하는 경우 올바르게 수정하십시오.) 먼저 가상 서버'$ venv \ Scripts \ activate'를 활성화 한 후 "$ virtualenv venv"폴더를 만듭니다. 그래서 전체 경로를 입력하고 pip를 입력하면 다음 오류가 발생합니다 : C : \ Users \ Daniel PC \ v env \ Scripts \ python.exe "" "C : \ Users \ Daniel PC \ venv \ Scripts \ pip.exe"실행 중 치명적인 오류 : ''''''''''''''''''''''''''''''''''''''는 기본 파이썬에서 가상 파이썬 – Sigils

+1

@Sigils 두 가지를 권하고 싶습니다. 첫째, 경로에 공백이 포함되지 않은 디렉토리에서 작업 해보십시오. 나는'C : \ var \ devel' 디렉토리를 가지고 있었고 거기에서 프로그래밍을하려고했습니다. 두 번째 : 이상적으로 Windows를 사용하는 가상의 튜토리얼을 찾아서 사용해보십시오. 활성화, 비활성화 등과 같은 기본 활동에 익숙해지면 여러 번 지불하게됩니다. 문제가 계속된다면 질문에 세부 정보를 추가하면 도움이 될 것입니다. –

+0

추천 해 주셔서 감사합니다! :) – Sigils

-2

Windows 7에서 실행하고?

  1. 클릭
  2. 검색 고급 시스템 설정을 시작하고 환경 변수에
  3. 를 클릭하십시오

    이보십시오.

  4. 경로 변수에 C : \ python27을 추가하십시오.
  5. 명령 프롬프트를 다시 시작하십시오.
+0

@grtPrgma PATH를 조작하는 것이 문제의 근원이 아니며 파이썬을 시작하는 데 문제가 없습니다. 문제는 활성화 된 virtualenv에 속하지 않는'pip'를 사용하는 것입니다. PATH를 조작하면 추가적인 문제가 발생할 수 있습니다. –

1

나는 정확히 있었다 너와 똑같은 문제가 생겼어. 잰의 대답은 나에게 도움이되지 못했다.

문제는 단순히 내가 apt-get을 사용하여 VIRTUALENV 설치이었다 : 핍로를 설치하는 대신

$ sudo apt-get install virtualenv 

을 :

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 
$ sudo python get-pip.py 
$ sudo pip install virtualenv 

그것은 나를 위해 문제를 해결했다. 당신은 후에 apt-get을 패키지를 제거 할 수 있습니다 (!하지만 좋은)

$ sudo apt-get remove virtualenv 

virtualenv 여전히 설치되어 있습니다.

관련 문제