The use of Windows virtual Environment in Pycharm

Source: Internet
Author: User
Tags virtual environment

Anaconda

Online for the installation of Anaconda is a lot of tutorials, here will provide you with a I was installed when the reference to the link address. Anaconda Introduction, installation and use of the tutorial

Creating a virtual Environment in Anaconda (command-line mode)

How to create a virtual environment in anaconda:

Here is the environment for creating the python=3.6 version, named py36

Conda create-n py36 python=3.6

Delete an environment

Conda remove-n py36--all

Activating the Environment

SOURCE Activate py36

Exit the Environment

SOURCE Deactivate

  • In the process of creating a virtual environment, I encountered a problem that was:如果创建了多个python版本的环境,那么我应该如何去管理当中所安装的不同的包呢?并且与本机原本安装的python环境不起到冲突?

  • I fix anaconda and native methods like this:

    • workaround one:

    In fact, Python provides us with two versions of the solution at the time of installation

    There is a py.exe in the Windows directory of drive C

    We can tell the Python version by starting with the Py.exe tool

    Start python2.7 pip

    Enter directly in the CMD window: py-2-m pip install XXXX

    Start python3.6 pip

    Type directly in the cmd window: py-3-M Pip install XXXX

    • workaround two:

    Find your native installed Python path (you can find it directly in path), then locate your Python.exe file and rename it.

    Such as: I renamed my native Python to Python3 and then did not rename the python that was installed in Anaconda.

    After a PIP installation is required for Python in Anaconda, enter:

    python-m pip install XXX

    And then, when installing the native Python, enter:

    Python3-m pip install XXX

  • I resolved the problem of Python conflicts with Anaconda itself after anaconda into the virtual environment:

    Depending on how you started the virtual environment above, we were able to start the virtual environment that was created

    After entering the virtual environment, enter:

    Python-v

    will be able to see the version number of Python in the current virtual environment

    At this time, enter:

    PIP List

    What you see is the package installed by the PIP in your current environment.

    如果你发现你的list还是Anaconda自带的list的话,就输入:

    python -m pip list

Creating a virtual Environment in Anaconda (GUI mode)

当你安装好Anaconda之后,会出现一个Anaconda Mavigator,点击之后在里面也可以创建虚拟环境。

Pycharm
    • The selection of the Settings Project Interpreter python version in Pycharm.

    • To find yours Anaconda 安装路径 .

    • Then find a folder inside it called envs .

    • In this folder there are all the virtual environments you create.

    • Select the virtual environment you need to use and then find it python.exe .

The use of Windows virtual Environment in Pycharm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.