Creating an Environment with a Specific Version of Python

I have downloaded and installed anaconda into my system.

But I am having error in creating an environment with a Specific Version of Python.

Please advise how to resolve this error.



 

Hi,



I tried the "link to my code file" link but it did not open anything. Thus, I am not able to understand the exact error you faced. Once Anaconda is installed, ideally you can just open the "anaconda Prompt" from your start menu bar and put in the following command.



conda env create -f https://quantra.quantinsti.com/downloads/machinelearning/environment.yml



(This is for machine learning.) But can you help me by giving the exact error you faced, so that we can resolve this issue?

Thanks Rekhit,

Above link worked but installation ended up with error. Please see below error msg and advise for a solution.













  Running setup.py install for python-Levenshtein: started

  Running setup.py install for python-Levenshtein: finished with status 'error'

|

Pip subprocess error:

  error: subprocess-exited-with-error



  × python setup.py bdist_wheel did not run successfully.

  ? exit code: 1

  ??> [28 lines of output]

      running bdist_wheel

      running build

      running build_py

      creating build

      creating build\lib.win-amd64-3.9

      creating build\lib.win-amd64-3.9\Levenshtein

      copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.9\Levenshtein

      copying Levenshtein_init_.py -> build\lib.win-amd64-3.9\Levenshtein

      running egg_info

      writing python_Levenshtein.egg-info\PKG-INFO

      writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt

      writing entry points to python_Levenshtein.egg-info\entry_points.txt

      writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt

      writing requirements to python_Levenshtein.egg-info\requires.txt

      writing top-level names to python_Levenshtein.egg-info\top_level.txt

      reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'

      reading manifest template 'MANIFEST.in'

      warning: no previously-included files matching '*pyc' found anywhere in distribution

      warning: no previously-included files matching '*so' found anywhere in distribution

      warning: no previously-included files matching '.project' found anywhere in distribution

      warning: no previously-included files matching '.pydevproject' found anywhere in distribution

      adding license file 'COPYING'

      writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'

      copying Levenshtein_levenshtein.c -> build\lib.win-amd64-3.9\Levenshtein

      copying Levenshtein_levenshtein.h -> build\lib.win-amd64-3.9\Levenshtein

      running build_ext

      building 'Levenshtein.levenshtein' extension

      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": Microsoft C++ Build Tools - Visual Studio

      [end of output]



  note: This error originates from a subprocess, and is likely not a problem with pip.

  ERROR: Failed building wheel for python-Levenshtein

  error: subprocess-exited-with-error



  × Running setup.py install for python-Levenshtein did not run successfully.

  ? exit code: 1

  ??> [30 lines of output]

      running install

      C:\Users\Hetal Shah\anaconda3\envs\quantra_py\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

        warnings.warn(

      running build

      running build_py

      creating build

      creating build\lib.win-amd64-3.9

      creating build\lib.win-amd64-3.9\Levenshtein

      copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.9\Levenshtein

      copying Levenshtein_init
.py -> build\lib.win-amd64-3.9\Levenshtein

      running egg_info

      writing python_Levenshtein.egg-info\PKG-INFO

      writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt

      writing entry points to python_Levenshtein.egg-info\entry_points.txt

      writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt

      writing requirements to python_Levenshtein.egg-info\requires.txt

      writing top-level names to python_Levenshtein.egg-info\top_level.txt

      reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'

Hi Hetal,



So one of the requirements for the smooth functioning of Python libraries is the Visual Studio whose version should at least be 14.0. This is why we are not able to complete the installation and set up of the Python environment.



You can go to the link: Microsoft C++ Build Tools - Visual Studio



And download the build tools.







Once the set up file is downloaded, click on the setup file and make sure you have selected the “C++ build tools” checkbox and further selected the 5 “optional” tools as well. These optional tools will be selected by default, but do check once. 



 



Follow the instructions during setup and the required packages will be installed.



You can then try installing the Python packages again by using the link: conda env create -f https://quantra.quantinsti.com/downloads/machinelearning/environment.yml



And this time the set-up will be complete.



Hope this helps.

Thanks Rekhit for your support.

Set-up has been completed successfully and now I am able to open jupyter notebook in my local system.