Just to state I don’t like virtual envs of any kind (i.e. I want to make it available to all users of python without any special commands beyond import). I installed the tensorflow GPU chain in conda and works well but I want to be able to use out side of conda since conda screws with my development enviromen (too much detail to go into here why but venv’s of any kind are incompatble with it).
- How do I get a list of all the packages I need to pip once out side
- Make sure pip does the steps needed to install a conda-forge package (tensorflow)
- Run all this outside of conda and have it install tensorflow-gpu not tensorflow-cpu
For #1, this may work: Install TensorFlow with pip. In the installation process, it does show, but I’m not entirely sure what you mean by your statement. Also, if you want clients to know, you could look into Poetry as it allows you to make a file with all the requirements where a user could simply install the Poetry file in the command prompt and be given the required items of download.
For #2, I’m not sure exactly what you mean, but you could maybe try this:
pip install --index-url https://pypi.anaconda.org/conda-forge/simple --extra-index-url https://pypi.org/simple tensorflow-gpu
--index-url specifies the index URL where pip should search for packages. In this case, it’s set to the conda-forge channel’s index URL and
--extra-index-url specifies additional index URLs that pip should search if it can’t find the package in the primary index URL. Here, it’s set to the default PyPI index URL. Using
--extra-index-url would also allow some conda-forge compatibility which is pretty useful for managing other packages. Essentially, it allows pip to search for packages in the conda-forge channel in addition to the default PyPI index. However, I’m not entirely sure if this goes with what you’re asking for, so I would dedicate some time to look into it.
For #3, I’m sorry but I’m not too sure on how to do that. You could maybe configure the download link to GPU instead of CPU version upon installation, but as for doing it without Conda, I’m not too sure why you would do that either as when you install packages system-wide, they are available to all Python projects on that system. If multiple projects require different versions of the same package or have conflicting dependencies, it can lead to conflicts and unwanted behavior. At the end of the day, if that is what you really need, I’d say go ahead with it, but be advised that it could go sour. Best of luck :).