The project in this example uses the flask package. If you’ve added a package to your P圜harm project that is not within the standard Python library, you can add it to your project’s conda environment with P圜harm. For more information on finding the correct environment, see Configuring a P圜harm Project with an existing conda environment.Ĭlick OK to finish changing your P圜harm project’s environment. Select whether to Make available to all projects. Specify the location of the Conda executable file. The directory where the new conda environment should be located must be empty. Select a new Python Interpreter by clicking the gear and then clicking Add. Select Project:, then Project Interpreter. Open the P圜harm project associated with the conda environment you want to change. You can use the following instructions to change your project environment preferences: Sometimes you may want to change the conda environment associated with an ongoing project. Switching environments within a P圜harm Project # If necessary, change the file path to your conda installation and choose whether to make this environment available to all P圜harm projects.Ĭlick OK and then Create to finish creating your new project. If that instance of Python exists, the file tree will open to its file directory and select it. Select the three dots beside Interpreter and copy the path. exe python C :\ Users \ doc \ anaconda3 \ envs \ my_env \ python. Open the correct environment using conda activate ENV-NAME, replacing ENV-NAME with the name of your environment. If the link to the correct environment’s bin folder does not appear in the Interpreter dropdown, you can easily find the file path using your Terminal or Anaconda Prompt: You can easily link an existing conda environment to a project in P圜harm using the following instructions:Ĭhoose Previously configured interpreter.Ĭlick the three dots to add a Python Interpreter. Let’s say you’ve already created a conda environment that you know will be perfect for your latest P圜harm project. Or you can look at the Environments tab in Navigator to see the same information:Ĭonfiguring a P圜harm Project with an existing conda environment # ( base ) C :\ Users \ doc > conda env list # conda environments: # base * C :\ Users \ doc \ anaconda3 pythonProject1 C :\ Users \ doc \ anaconda3 \ envs \ pythonProject1 Specify the location and name of the new conda environment in Location. Your New environment should use Conda instead of the default Virtualenv. Use Location to change your project’s name and file location, if necessary. P圜harm will create a basic conda environment for you (with a selected Python version) as part of an initial project setup, and will link your P圜harm project to that environment.Īfter opening P圜harm, click New Project. Creating a new conda environment from a P圜harm project # You can create a new conda environment when you create a new Python project in P圜harm, configure an existing conda environment to a new project, or switch conda environments within a project that already exists. Conda environments can be used with P圜harm projects to ensure that each of your projects are being built and run to the exact Python specifications that they require. Many times, Python projects will require very different setups, with access to different versions of Python and different packages and their dependencies. This topic will cover the following: Configuring a conda environment in P圜harm # P圜harm also supports creating virtual environments for Python with conda. P圜harm is an IDE that integrates with IPython Notebook, has an interactive Python console, and supports Anaconda as well as multiple scientific packages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |