![]() So apparently both outputs are different, and my theory is: once I generate my requirements.txt with conda on my project, other developers can't choose virtualenv instead - at least not if they're not prepared to install a long list requirements by hand (it will be more than just the aiohttp module of course).Ī first sight, importing the conda-generated requirements.txt in a project on virtualenv ( pip install -r requirements-conda.txt) throws this error: Invalid requirement: 'aiohttp=2.3.9=p圓6_0' pip freeze > requirements.txt then generates: aiohttp=3.0.1 I set up an empty project in a virtualenv environment and installed the aiohttp module there too. Then conda list -export > requirements.txt generates the following: # This file may be used to create an environment using: I set up an empty project in an Anaconda environment and installed the aiohttp module. I was wondering though, when other developers want to contribute to the project, but want to use virtualenv instead of Anaconda, can they do that? I'm generating a requirements.txt so other people can easily set up their own virtual environment for the project. Removing temporary dir C:\Project\env\build.I'm setting up a python project, using an Anaconda virtual environment. Local files found: C:/Project/wheelhouse/azure-0.8.0-p圓-none-any.whl Running setup.py (path:C:\Project\env\build\azure\setup.py) egg_info for package azureīuilding wheels for collected packages: azureĭestination directory: c:\project\wheelhouseĬ:\Project>pip install -r requirements.txt -vĭownloading/unpacking azure=0.8.0 (from -r requirements.txt (line 3)) ![]() For example, you may prefer to use pip wheel to compile a dependency and add the -find-links option to your requirements.txt: C:\Project>pip wheel azure In this case, manually edit the file to exclude this package or to use pip's options to refer to an installable version of the package. If pip doesn't install a package, and the package appears in a requirements.txt file, the entire installation fails. The requirements files include packages even if they were installed with a version range, as a dependency of another package, or with an installer other than pip. Using precise versions, you can easily reproduce your environment on another computer. The requirements.txt files contain precise versions of all installed packages, and you can use these files to freeze the requirements of an environment. Update and add entries refreshes any requirements that are found, and adds all other packages to the end of the file.Refresh existing entries detects package requirements and updates the version specifiers to match the version you currently have installed.Replace entire file removes all items, comments, and options that exist. ![]() If the file already exists, a prompt appears for how to update it: If you already have all the necessary packages installed in an environment, you can right-click that environment in Solution Explorer and select Generate requirements.txt to create the necessary file. For more information on creating a virtual environment, see Use virtual environments. If you want to install the dependencies in a virtual environment, create and activate that environment first, then use the Install from requirements.txt command. If you've loaded a project that contains requirements.txt and wish to install all the packages listed in that file, expand the Python Environments node in Solution Explorer, then right-click an environment node and select Install from requirements.txt: ![]() Technically, any filename may be used to track requirements (by using -r when installing a package), but Visual Studio provides specific support for requirements.txt: The most common command is pip freeze > requirements.txt, which records an environment's current package list into requirements.txt. The recommended approach is to use a requirements.txt file () that contains a list of commands for pip that installs the required versions of dependent packages. If you share a project with others, use a build system, or plan to copy the project to any other location where you need to restore an environment, you need to specify the external packages that the project requires. Applies to: Visual Studio Visual Studio for Mac Visual Studio Code
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |