0

Hi I recently tried to install tensorflow using pip install --user --upgrade tensorflow but it gives an error

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

which I believe is because my python version, i.e. 3.9, is not supported. Although it is not recommended, I also downgraded to python 3.8 using pacman -U, but then:

Traceback (most recent call last):
  File "/usr/sbin/pip3", line 33, in <module>
    sys.exit(load_entry_point('pip==20.2.1', 'console_scripts', 'pip3')())
  File "/usr/sbin/pip3", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.8/importlib/metadata.py", line 504, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: pip

How would you go about installing tensorflow on a rolling release system like Arch Linux?

2 Answers 2

0

I would go with something like Pyenv which allows you to install multiple versions of Python on a single system.

https://github.com/pyenv/pyenv

I don't think there's an official package but you can probably get it from AUR or install it from source as described in the project.

Then run this command to start it up on your Shell launch:

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile

Modify it if your using Zsh or Fish according to the docs.

Then you can install the version you need:

pyenv install 3.8

Then you can just create a file called .python-version in your local project with the version number in it and you should be able to run that version of Python when running commands

0

Downgrading packages is discouraged, in particular if that package is the dependency of many system-level packages: some of them may lies on /usr/lib/python3.8 and some other in /usr/lib/python3.9, not allowing to see each other. I suggest you to revert the downgrade with sudo pacman -S python.

Rather then pyenv, I personally prefer Anaconda, that can be installed with minimal footprint with miniconda3, from the AUR (it was flagged as out-of-date two weeks ago but it is still maintained, it's just the publisher that comes always a little late).

conda can be easily used to create a new environment with

conda create -n tensorflow python=3.8

and activated with

conda activate tensorflow

tensorflow is obviously the produced environment name and can be anything, while the latter element (python=3.8) is the desired package that you want to install (pip will be automatically installed).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .