![]() This is how we create the Conda-flavored environment file. The first line of the yml file sets the new environment's name. If Adam uses Conda to manage his environments, then all he need to do create his Conda from the environment.yml file: conda env create -f environment.yml To overcome this, we are using two different environment files, each in their own distinct format allowing for other contributors to pick the one they prefer. In the project directory above, we have both environment.yml (for Conda users) and requirements.txt (for pip). To accomplish what you're looking for, here is a simple directory that we'll use as reference. Yes - in fact this is how many of my projects are structured. 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 setting up a python project, using an Anaconda virtual environment. Did you mean = ?Īm I right when I think that if developers would like to do this, they would need to programmatically change the package list to the format that virtualenv understands, or they would have to import all packages manually? Meaning that I impose them to choose conda as virtual environment as well if they want to save themselves some extra work? 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'm generating a requirements.txt so other people can easily set up their own virtual environment for the project.
0 Comments
Leave a Reply. |