Deploying a Python environment using anaconda in Python-pycharm

Source: Internet
Author: User
Tags virtual environment pycharm download pycharm community edition

Deploying a Python environment using anaconda in Pycharm

Today, for example, the anaconda of a management pack in Python makes it easy to manage the various packages in Python. I believe everyone will have this experience, in Pycharm is also a package automatic search and download features, this I have in a previous blog related to the introduction (see Click to open the link), but this feature is available for some packages, but always encounter some package download failure or query, It's going to be a pain in the back of the day. Here we'll take a look at the benefits of Anaconda.

Here's what I've been pasting from somewhere else:

Anaconda advantages summed up on eight words: Save time worry, analysis of the weapon.

    • Save time and hassle: Anaconda simplifies your workflow by managing the toolkit, development environment, and Python version. It is not only easy to install, update, uninstall the toolkit, but also to install the appropriate dependencies automatically, while you can use different virtual environments to isolate the different requirements of the project.

    • Anaconda: The Python tool for enterprise-class big data analytics, which is how you advertise yourself in the official website. It contains more than 720 open source packages related to data science, and is involved in data visualization, machine learning, deep learning and many more. Not only can do data analysis, can even be used in the field of big data and artificial intelligence.

I want to talk about Anaconda's "handsome" in a popular way.

(1) When we install the Anaconda, this tool will bring a lot of Python packages, we can see in the Pycharm visual.

(2) In our need to use the package system does not exist, we can be very worry about the online download of the package, absolutely let you very satisfied.

Nonsense on this point, the following specific Anaconda installation and brief use of the method.

Anaconda Installation

  1. First we go to Anaconda's official website (click to open the link), as shown, you will see the Anaconda download page:
  2. Drop-down or click the Windows option in the diagram to get the interface as shown, you can choose 2.7 or 3.6 depending on the version you want, and of course you can install the other version.
  3. Click the download button in the image to download the Anaconda, then you will get a Anaconda exe executable file.
  4. Double-click the executable file and get it as shown in:                           & nbsp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp      
  5. Click "Next" to enter the following interface:                             &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                                  &NBS P;
  6. Click "I Agree" directly to enter as:
  7. This is the first choice, because we generally only use an account (of course, there is a need to choose a second, here is no hindrance), click "Next":
  8. Click "Browse" in the figure to select where to install the file (generally not recommended for installation on C drive), then click "Next" to:
  9. The second option here is not to tick (because we may use the default Python.ext, this will create a conflict), when needed we can find the file in the Pycharm installation location to add, click "Install", then you can install, Then wait for the installation to complete.

Pycharm Import Anaconda

    1. In Pychar, click File, and then select Settings, and then click as follows:
    2. In the Settings window, select the option indicated by the arrow in the diagram, and you'll see "Project interpreter" on the right. Then the box inside should choose your anaconda in the Python.exe position, make your own choice, and then you will get the interface as above. (as I have done before, so I do not repeat the operation).
    3. Click "OK" and we have finished this work.

Anaconda Download Python's Package

Here, I used to compare the "stupid" method, set the environment variable what is saved, if necessary, you can check the relevant information on the Internet.

    1. Open the CMD window (shortcut key win+r, and then enter "CMD"), such as:
    2. Perform the operation as shown in the arrows to locate the current directory to the Anaconda directory, remember to locate it in the Scripts directory, my directory is "D:\Users\lenovo\Anaconda2\Scripts", so I navigate to this file location. Then we can use PIP to install it, Remember this pip is Anaconda pip tool (if you have Python.exe, then the PIP in your user directory is also operable, but the PIP is not in Anaconda, so please remember to switch to this directory after PIP installation), here I use pi P Install cocos2d Command "cocos2d" This package installation, then wait for the installation to complete.
    3. This completes the installation of the package. Well, this time the introduction is over.

Installation and use of Anaconda and Pycharm under Windows Anaconda with Pycharm

Main reference URL:
1, http://www.jianshu.com/p/169403f7e40c
2, http://blog.csdn.net/qq_29883591/article/details/52664478


1. Anaconda

(Here are some words of saliva, you can understand a little bit, do not have to too much discretion?? )
?? Anaconda is a python release that uses Python and many of the most commonly used packages (Python open source package) to be packaged directly to support Windows, Linux, and MacOS systems. And there is a Conda (open source package packages and virtual Environment Environment Management system) a powerful execution tool.
?? Anaconda advantages summed up on eight words: Save time worry, analysis of the weapon.
?? Save time and hassle: Anaconda simplifies your workflow by managing the toolkit, development environment, and Python version. It is not only easy to install, update, uninstall the toolkit, but also to install the appropriate dependencies automatically, while you can use different virtual environments to isolate the different requirements of the project.
?? Anaconda: The Python tool for enterprise-class big data analytics, which is how you advertise yourself in the official website. It contains more than 720 open source packages related to data science, and is involved in data visualization, machine learning, deep learning and many more. Not only can do data analysis, can even be used in the field of big data and artificial intelligence.

Download of 1.1 Anaconda
?? You can download the Anaconda installer from the official website https://www.anaconda.com/download/, select the System (Windows, MacOS or Linux) and the number of operating systems (64-bit or 32-bit) for your computer. As for the Python version is 3.6 or 2.7, it is recommended that you use Python 3.6 version, because Python2 will eventually stop maintenance. Take windows and 64-bit systems for example, download Python 3.6 version of the Select interface 1 shown.



Figure 1. Download of Anaconda

Installation of 1.2 Anaconda
?? After downloading the file as an. exe file, double-click the file to enter the installation interface.
?? 1. Click next–> I agree–> next to enter the Select installation directory interface.
?? 2, in the selection of the installation directory interface, the default installation path is C drive. If you want to change the installation path, first create a new Anaconda3 folder in the directory you want to install, and then select the path. (Installation path According to their actual situation, not recommended to install on the C drive, my installation path is shown in f:\anaconda3\,2).



Figure 2. Select the installation directory interface

?? 3, then click Next to enter the advanced options interface. With two option boxes, it is recommended that the first option box (add Anaconda to my PATH environment variable, which is not selected by default) be selected. Then click Install, wait for the installation to finish click Next–> Finish (the installation process may be longer, 10 ~ 15 minutes, please wait patiently?? )。
?? 4. You can enter the conda–version command on the command line to verify that the installation is successful, the corresponding version is displayed successfully, and you can view the default Python version of the release by using the Python–version command (if the 3rd step is add Anaconda to my PATH Environment variable option box selected).

1.3 Anaconda Python Package management
?? ( since Anaconda contains most of the commonly used Python open source packages, this step is not necessary?), when you really need to install a package, you can first query the installation package for the Python package, and then follow the corresponding command installed .
?? command to install a package: Conda install Package_name.
?? Here Package_name is the name of the package that needs to be installed. You can also install multiple packages at the same time, such as installing NumPy, scipy, and pandas, and execute the following command: Conda install numpy scipy pandas.
?? You can also specify the installed version, such as installing the 1.1 version of Numpy:conda install numpy=1.10.
?? Removing a Package:conda remove package_name
?? Upgrade Package version: Conda update package_name
?? View all Packages:conda list
?? If you can't remember the specific name of the package, you can also make a fuzzy query: Conda search search_term.

2 Pycharm
?? Pycharm is a Python IDE with a complete set of tools to help users improve their efficiency when developing with the Python language, such as debugging, syntax highlighting, project management, code jumps, smart tips, AutoComplete, unit tests, versioning.

Download of 2.1 Pycharm
?? You can download the Pycharm installer from the official website https://www.jetbrains.com/pycharm/download/, and select the System (Windows, MacOS or Linux) for your computer on this page. Since the Pro version (Professional) needs to be activated, and the Community Edition (Community) already contains the basic features we need, here we choose the Community Edition (Community) Download ( Of course, there is a Professional version of the activation code on the Internet, But not all can be used, if you want to use the professional version can be self-surfing Internet query crack method ). Take windows as an example, as shown in download interface 3.



Figure 3. Pycharm Download interface

Installation of 2.2 Pycharm
?? After downloading the. exe file, double-click the file to enter the installation interface.
?? 1, click Next to enter the installation directory selection screen, select the directory you want to install Pycharm. My installation path is F:\Program files\pycharm Community Edition 2017.2.3, 4.



Figure 4. Pycharm installation Directory Selection interface

?? 2, click Next to enter the next interface, according to the number of their own computer operating system (64-bit or 32-bit) Select Create Desktop Shortcut, interface 5 is shown.



Figure 5

?? 3. Click next–> install–> Finish to complete the installation of the software.

Use of 2.3 pycharm
?? 1, click on the Pycharm icon on the desktop, open the interface as shown in 6, click OK to continue.



Figure 6

?? 2. Click accept? OK enter as shown in 7.



Figure 7

?? 3. Click Create New Project to enter the interface like 8. The location in the diagram is the choice of where you created the Python project and the project name (according to your own case, the default bit c), 8, my project directory is F:\Workspace\PycharmProjects, the project name is test ( can be randomly taken the interpreter in the diagram is the interpreter for you to install Python, which, by default, has helped you to select the Python.exe file under the Anaconda installation directory. When you have selected, click Create.



Figure 8

?? 4, enter the interface as shown in 9, the right mouse button click on the project name (Arrow point), and then new select Python file, in the popup interface to fill in the name of the new Python files (any fill).



Figure 9

?? 5. After the file is created, enter the interface as shown in 10 and the new Python file appears under the new project. After that, you can write your own program.



Figure 10

Deploying a Python environment using anaconda in Python-pycharm

Related Article

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.