When you create a project in PyCharm, pip failure in python virtual environment created

In this blog, I briefly described the problems I encountered when creating a project using the flask PyCharm, as well as the process I solve this problem. The more points worth noting are: ①PyCharm interpreter when you create a new project configuration ②Python create a virtual environment and so on.

I. Description of the problem

When you create a flask project in pyCharm in that, in establishing a good virtual environments, has started installing flask with pip tools, software tips: Install flask failed. as the picture shows:

Error messages encountered when creating a project PyCharm

 

My PyCharm version 2019.2.3 Professional Edition (white mailbox with education of prostitution, thanks JetBrains).

And I have never met a problem pip failure in my favorite Python global interpreter!

 

 Second, the solution

[(I) a failure (can skip)] in accordance with the error in the "Proposed solution" be tried

① Open the terminal PyCharm, use the cd command to enter the project folder \ venv \ Scripts, open activate.bat file. Manually activate the virtual environment PyCharm configured for this project.

② try pip install flask, the results as shown below, and in fact, exactly the same as the previous error.

Manual pip install flask error encountered

③ try pip try to install a few other things, and the results of the previous step as

④ trial PyCharm try to create a Django project, result in the automatic use pip install django, there was the same problem the second step.

⑤ can initially concluded that: In this virtual environment, pip ineffective! As for why the failure, the error is written: pip configure the desired position tls / ssl, but in python ssl module is not available. To be honest, I do not understand.

[Ii] successfully resolved choice about when creating a new project based on who the interpreter is created

 

Due to the current ssl really do not understand this, but feel inside some online blog to talk about things too iffy, I was thinking a little simply to direct, to PyCharm created virtual environment to replace a try.

When I try to create a new flask project again, I pay more attention to a little alternative when you create some configuration, my god, I feel a little collapse, the original ~~~ PyCharm created this virtual environment is based on the default I do not how anaconda use in the past.

Configurable items when creating a project PyCharm

 

When I changed my usual Based Interpreter Python interpreter (python installed from the official website) when the project will create successful, what problems did not happen!

Often, people feel in a daze when the stomach a little uncomfortable, as one Xunyiwenyao busy, not knowing that their own forgotten and hungry.

(Iii) summary

 

① I managed to solve my current problems, the problems for the anaconda python interpreter I really know nothing about, but fortunately I did not need at present to know was so fine.

② When using Python much use when there are multiple systems easily python interpreter, this time he is very easy to be confused. My advice is: configure your own directory that the most commonly used where only an interpreter environment variable system, and as a global interpreter, elsewhere require a separate python interpreter when using a virtual environment ( You can create using hand tools and other vitutual or pypenv, it can also be created automatically when you create a project with such PyCharn integrated development environment, but no matter where creation, both got to pay attention to is based on a reliable Python interpreter created!).

③ when a new project PyCharm created, it can be configured interpreter of the project that will be used, you can choose: storage location ⑵ ⑴ new virtual environment python interpreter which interpreter based on the new virtual environment python interpreter ⑶ use existing virtual environment interpreter ......

Guess you like

Origin www.cnblogs.com/scwjy/p/11619425.html
Recommended