Pip install tensorflow error

Создание и установка сообщений об ошибках TensorFlow использует проблемы GitHub , Stack Overflow и форум TensorFlow для отслеживания, документирования и обсуждения проблем сборки и установки. В следующем списке сообщения об ошибках связаны с решением или обсуждением. Если вы обнаружите проблему установки или сборки, которой нет в списке, выполните поиск по проблемам GitHub и Stack […]

Содержание

  1. Создание и установка сообщений об ошибках
  2. pip Install Error: don’t could find version that satisfies the requirement tensorflow #39130
  3. Comments
  4. pip install tensorflow could not find a version #37457
  5. Comments
  6. Tensorflow release 2.2.0 not found via pip install #39265
  7. Comments
  8. Tensorflow 1.15 doesn’t exists within pip install #34302
  9. Comments
  10. URL(s) with the issue:
  11. Description of issue (what needs changing):

Создание и установка сообщений об ошибках

TensorFlow использует проблемы GitHub , Stack Overflow и форум TensorFlow для отслеживания, документирования и обсуждения проблем сборки и установки.

В следующем списке сообщения об ошибках связаны с решением или обсуждением. Если вы обнаружите проблему установки или сборки, которой нет в списке, выполните поиск по проблемам GitHub и Stack Overflow. Если вы по-прежнему не можете найти сообщение об ошибке, задайте новый вопрос в Stack Overflow с тегом tensorflow .

Проблема с GitHub или переполнение стека Сообщение об ошибке
38896424 31058 «Для tensorflow не найдено подходящего дистрибутива»: Pip не может найти пакет TensorFlow, совместимый с вашей системой. Проверьте системные требования и версию Python
22390
36159194
41991101
36371137
35252888
33623453
42006320
35190574
42009190
36933958
42006320
33623453
35190574
42009190
33622019
37810228 Во время операции установки pip система возвращает:
33622842 Оператор import tensorflow вызывает следующую ошибку:
42075397 Команда установки pip вызывает следующую ошибку:.
41007279
41007279
42006320
42011070
42217532
43134753
38896424
42006320
33623453
35190574
42009190
33622019
37810228 Во время операции установки pip система возвращает:
33622842 Оператор import tensorflow вызывает следующую ошибку:
41293077
42013316
42013316
35953210 При вызове `python` или `ipython` возникает следующая ошибка: .
45276830
47080760
22512
22512 , 22794
24835

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

pip Install Error: don’t could find version that satisfies the requirement tensorflow #39130

hi, I have win10 and I have tried install through cmd tensorflow with:
pip install tensorflow
pip install tensorflow-cpu
pip3 install —upgrade tensorflow

All these pip gave me the same error:

what’s happened? What I need do to fix it?

The text was updated successfully, but these errors were encountered:

I have a possibly related issue: when I use
pip install tensorflow
pip installs the most recent release candidate: https://pypi.org/project/tensorflow/2.2.0rc4/
I’m trying to get the most recent stable version, 2.1.0.

When I try:
pip install tensorflow==2.1.0

I get the error message:

I updated pip to 20.1. Same behavior.
I tried:
pip install tensorflow>=2.0.0
And still got ver 2.2.0rc4

Why is pip installing only the rc’s?

Okay, I think I figured out my issue: I was using Python 3.8 in my environment. I made a new environment using Python 3.7, and the install worked fine.

@an-white,
TensorFlow 2 packages require a pip version >19.0. Could you please upgrade pip using the below command and let us know if it works.

pip install —upgrade pip .

For more information please check this TensorFlow guide. Thanks!

hi, I forgot say that I have python 3.8, this can affect? When I have already upgrade pip, this occurs:

@an-white : I suggest creating a new env with python 3.7 and try installing TF2 there.

Okay, I think I figured out my issue: I was using Python 3.8 in my environment. I made a new environment using Python 3.7, and the install worked fine.

I saw this recommendation on other forums and tried it, but it didn’t work for me.

I’ve tried on 3.7.0 and 3.6.4

Okay, I think I figured out my issue: I was using Python 3.8 in my environment. I made a new environment using Python 3.7, and the install worked fine.

I saw this recommendation on other forums and tried it, but it didn’t work for me.

I’ve tried on 3.7.0 and 3.6.4

As I expected the problem was my fault. but I think is something that can pass unnoticed and explaining it here may help people with a similar setup and issue.

I’m using Python via pyenv-win which is great, but the thing is that I didn’t realize that pyenv install X.Y.Z will install the 32bit version and tensorflow requires 64bit. So, in my case, it was just a matter of installing an actual 64bit version with pyenv install X.Y.Z-amd64

hi, I forgot say that I have python 3.8, this can affect? When I have already upgrade pip, this occurs:

@an-white,
TensorFlow v2.1 is not compatible with Python 3.8. Instead, could you please try installing TF v2.2.0rc4 using the below command

pip install tensorflow==2.2.0rc4

@an-white,
Also, could you please check if you are using the 64 bit version of Python. TensorFlow is tested and supported only on 64-bit systems. Thanks!

Ok, thanks I’m going to check all this recommendation and find if works

Ready thank you so much, the problem was the version that I have of python 32 bit, and already I install the 64 bit version and only need wait for this finish

Now only need wait, any other problem I’ll tell you

Источник

pip install tensorflow could not find a version #37457

System information

  • macOS Catalina version 10.15.3
  • pip install tensorflow
  • GPU model and memory: Intel Iris Plus Graphics 645 1536 MB

The problem
Both pip install tensorflow and pip install tf-nightly lead to the following error messages:

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)

ERROR: No matching distribution found for tensorflow

The text was updated successfully, but these errors were encountered:

Did you try updating your pip version?

As per the documentation TensorFlow 2 packages require a pip version >19.0.

Could you please try the following commands and let us know if it works.
python3 -m pip install —upgrade pip or pip install —upgrade pip and then try

pip install tensorflow

@alexcreature Try updating pip version by:

and the you can again install tensorflow by:

or you can specify version which you want to install.

This seems to be the same as an issue I had previously with both Windows 10 and Ubuntu 18 and Ubuntu 16, no matter the operating system.
The previous issue ( #37205 ) was closed because I proposed a WORK AROUND of downloading the .whl and installing Tensorflow through the downloaded wheel, which worked just fine for me.

Something is broken in the pypi pipeline of installation and needs to be taken care of.

Yes, the issue is that systems use old pip / setuptools by default and these don’t know how to install packages with manylinux2010 tags. That’s why you need to upload pip and setuptools first (and always install in a virtualenv, not globally)

@alexcreature,
Any updates regarding this issue? Thanks!

Yes, the issue is that systems use old pip / setuptools by default and these don’t know how to install packages with manylinux2010 tags. That’s why you need to upload pip and setuptools first (and always install in a virtualenv, not globally)

Okay so here are ALL of the things I have tried in my attempts to simply install tensorflow via pip install:

pip 20.0.2
Python 3.7.6
Win10, globally
Ubuntu 18.04, globally (source built python 3.7.6 and alias setup to avoid breaking apt)
Ubuntu 16.xx, globally, same as above
Win10 pipenv environment (most recent version of pipenv)
Ubuntu 16, 18 pipenv environment (most recent version of pipenv)

I have tried and tested everything I can possibly come up with to make things different but nothing seems to install Tensorflow 2.1 for Python 3.7 for me, in any way shape or form. I have tried pip install tensorflow I have tried pip install tensorflow==2.1 and the absolute only thing I can do is install by downloading the wheel and installing that wheel directly.

Is there something we can do with pip or python source to get this back to working properly? I don’t have ANY issues with any other packages I use across the board, except for Black, but even then sometimes that will install without a hitch and other times I get the same error, though it’s been a long time since I tried and that is not relevant to Tensorflow.

Edit: I cannot find any PEP which shows a breaking change in manylinux tags and pip installs. The most relevant is 571 which states that any pip that is capable of installing manylinux2010 tags will be backwards compatible, and 600 which shows a new naming convention for manylinux tags, but also states that old tags should still work, if I’m reading correctly.
PEP 599 also adds the manylinux2014 tag, however in true python fashion, retains support for manylinux1 and manylinux2010 tags, so this definately should not be the issue, however, I am no source developer and am simply relaying the information I have found.

These are the most relevant PEP’s I have found regarding manylinux wheel tags.

Источник

Tensorflow release 2.2.0 not found via pip install #39265

tldr; pip does not find the new release 2.2.0 published yesterday

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Not Applicable
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu Server 20.04
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): Not Applicable
  • Python version: 3.8.2
  • PIP version: 20.1
  • CUDA/cuDNN version: Not Applicable (10.2)
  • GPU model and memory: Not Applicable (RTX 2080 Ti)

Describe the current behavior
From the change log and the Github releases I noticed that Tensorflow 2.2.0 was released and that I could upgrade the Tensorflow version currently used in my project (2.2.0rc4). Sadly, pip install failed to install the update as it was unable to find release 2.2.0. (Clearing the cache of pip didn’t help.) The PyPi website also says latest version is the rc4, not the 2.2.0 release.

Describe the expected behavior
Well, I would like to be able to install Tensorflow 2.2.0 over pip .

Standalone code to reproduce the issue
pip install tensorflow==2.2.0

Other info / logs

The text was updated successfully, but these errors were encountered:

Источник

Tensorflow 1.15 doesn’t exists within pip install #34302

Thank you for submitting a TensorFlow documentation issue. Per our GitHub
policy, we only address code/doc bugs, performance issues, feature requests, and
build/installation issues on GitHub.

The TensorFlow docs are open source! To get involved, read the documentation
contributor guide: https://www.tensorflow.org/community/contribute/docs

URL(s) with the issue:

Please provide a link to the documentation entry, for example:
https://www.tensorflow.org/install/pip

Description of issue (what needs changing):

It says tensorflow 1.15 is final version for 1xx versions yet pip install 1.15 returns this

«$ pip3 install tensorflow==1.15
Collecting tensorflow==1.15
Could not find a version that satisfies the requirement tensorflow==1.15 (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow==1.15
«

It should be corrected I think.

The text was updated successfully, but these errors were encountered:

Источник

Internship at OpenGenus

Get this book -> Problems on Array: For Interviews and Competitive Programming

In this article, we have presented the reason behind the error «No matching distribution found for TensorFlow using pip» along with 3 approaches to fix it.

Command used:

pip install tensorflow --user

Error:

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

Table of contents:

  1. Reason behind the error
  2. Fix 1: Install wheel file directly
  3. Fix 2: Update Python and Pip
  4. Fix 3: Build TensorFlow from source

Reason behind the error

The reason behind the issue will be that the Python installed on your system does not have a corresponding TensorFlow.

Through pip, TensorFlow only supports specific Python version and cases such as:

  • 64-bit system
  • Python version 3.7 to 3.10
  • Ubuntu 16.04 and later versions
  • Windows 7 and later version (with C++)

So, if your system has 32-bit version of Python or a lower version of Python or an older Ubuntu version, then you will face this error.

Different TensorFlow have different dependencies. For example, TensorFlow version 1.12.0 works with Python version 3.5.2 only while TensorFlow version 2.10.0 requires Python version 3.8+.

Fix 1: Install wheel file directly

If you have a pre-built wheel file that matches your system’s Python and pip version, you can install the wheel file directly.

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-2.10.0-py3-none-any.whl

Fix 2: Update Python and Pip

Installing TensorFlow using pip requires you to have 64-bit version of Python version 3.5 to 3.8 and pip version 8.1 and above.

If you have a lower version, upgrading Python and pip will fix the problem.

pip install --upgrade pip

Fix 3: Build TensorFlow from source

If you build TensorFlow from source, you will not face this issue and TensorFlow will get build with any version of Python and pip.

  • Follow these steps:
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
./configure
  • Build the pip wheel file
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mavx512
--copt=-mavx512f --copt=-mavx512vnni --copt=-mfpmath=both --copt=-msse4.1 
--copt=-msse4.2 -k //tensorflow/tools/pip_package:build_pip_package

Note the optimization flags used such has—copt=-mavx512f

  • Prepare the wheel file
bazel-bin/tensorflow/tools/pip_package/
build_pip_package /tmp/tensorflow_pkg
  • Install the wheel file and use TensorFlow
pip install tensorflow-2.10.0-wheel --force

With this article at OpenGenus, you must have fixed the issue of installing TensorFlow using pip.

Tensorflow is an open-source platform for Artificial intelligence and it comprises of extensive libraries and community resources that lets researchers push the state-of-the-art in Machine Learning and engineers effectively manufacture and embed ML controlled applications on Microcontrollers and Microprocessors. The computer geeks are able to install Python and PyCharm easily on their systems but when they try to install Tensorflow they encounter the error message: “Could not find a version that satisfies the requirement TensorFlow (from versions: ) No matching distribution found for TensorFlow”. Many people have installed Flask to get rid of this issue but they aren’t able to hence, keeping this in view I’ve compiled some possible solutions to this problem and follow this guide throughout to get rid of this error.

TensorFlow Error

As it turns out, there are several different causes that might end up causing this issue hence let’s move a step ahead and test some fixes until we are able to eliminate this glitch on Windows.

Method 1: Verify Python Version On Your System

If you are running Windows 10, with Python 3.6.X version on your system then most probably Python-32 bit version would’ve been running on 64bit machine. Keep one thing in mind that TensorFlow is only compatible with 64bit installation of python and not 32bit version of python. If you’ve downloaded Python from python.org, the default installation would be 32 bit hence in order to get rid of this issue download a 64bit installer from here. Now, we need to set the PATH environment variable because it lists the directories that will be searched for executables when you type a command in the command prompt. By adding the path to the Python executable, you will be able to access python.exe by typing the python keyword (you won’t need to specify the full path to the program). If the PATH variable is not set the following error occurs:

C:>python
'python' is not recognized as an internal or external command,
operable program or batch file.

As you can see that the command was not found hence to run python.exe, you need to specify the full path to the executable hence to specify the full path to the variable, follow the steps indexed below:

  1. Right-click on My Computer and afterward click on Properties button.
    Choose Properties
  2. On the left side of the window look for Advanced System Settings and after clicking on it you’ll observe that System Properties Window will be opened.
    System properties
  3. Now look for PATH variable option and click on Edit. Position your cursor at the end of the Variable value line and add the path to the python.exe file preceded with the semicolon character (;). In my case, I have added the following value: C:Python36 because I want to run Python 3.6 version.
    Assign Variable Value
  4. Close all the Windows and search for Command Prompt. In the command window type the following command and hit enter. You’ll see that now the 64bit version is present on your system and now I’ll try to install TensorFlow and check whether the error is still there or not:
    C:>python --version
    
    Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
  5. Run the following command to install TensorFlow on your system and hopefully now the installation will proceed without any error message. Note: TensorFlow is not yet in the PyPI repository, so you have to specify the URL to the appropriate “wheel file” for your operating system and Python version.
    pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

    Install Tensorflow

Method 2: Downgrade Your Python Version On Anaconda

Tensorflow only supports Python 3.6.x and only the 64bit version. Hence if you are running GUI like anaconda and python 3.7 is installed by default on it hence, we have to downgrade it to 3.6 to install the Tensorflow. For doing this task run the commands stated below on your Anaconda prompt:

conda install python=3.6.4

After running this command wait for a couple of seconds and then create a Virtual Environment for installing Tensorflow. Name the virtual environment such as “ab” and then install the current release of CPU-only TensorFlow:

conda create -n ab tensorflow
conda activate tf

After downgrading your python version the Tensorflow will now be installed without displaying any error and even if you’ve installed the Desktop version of Ubuntu it will work for that too.

Method 3: Update Package Installer For Python

Pip is the package installer for Python and we can use pip to install packages from the Python Package Index and other indexes. Although updates are released regularly after three months and these packages need to be updated manually on your system by running certain commands. If these are not outdated they might cause this Tensorflow installation error hence, we will update the pip package by running the following commands below so that all the packages are updated automatically:

pip install --upgrade pip

pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

After updating the pip packages hopefully, your installation will run smoothly and you’ll be able to develop interesting programming projects using Tensorflow now.

Workaround: There may not be a version of TensorFlow that is compatible with your version of Python. This is particularly true if you’re using a new release of Python. For example, there may be a delay between the release of a new version of Python and the release of TensorFlow for that version of Python. In this case, I believe that the options mentioned above like downgrading to the previous version of Python, Compiling TensorFlow from the source code and waiting for a matching version of TensorFlow to be released are all the possible remedies that could allow you to install Tensorflow on your system without any glitches.

Photo of Kevin Arrows

Kevin Arrows

Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Python is known for its versatile syntax and English-like keywords. With thousands of modules, you can do data visualization, data processing and even deploy machine learning models. There are many known machine learning models published which help you, namely, Keras, Sklearn, Tensorflow, and PyTorch. Although, while using Tensorflow, you can encounter a No Module named Tensorflow error while running your first program.

No Module Named Tensorflow Error is a known error that arises when the Python Environment is unable to fetch TensorFlow files in site-packages. There are two main reasons for this error to appear, either you have not installed the TensorFlow external module or you are working on a different python environment that doesn’t have Tensorflow. There are several easy ways to fix this error which are mentioned later in this post. Let’s understand the root cause of the error before jumping on the solution.

No Module Named Tensorflow Error

When a module is absent from the external site-library of the environment, the Python interpreter throws ModuleNotFoundError No Module Named Tensorflow. This error arises most of the time on low-end devices because TensorFlow requires proper setup of the c++ path and other requirements. Most of the time, this error is solved by using the pip install method. But if you have multiple Python versions installed, then you’ll definitely face this error.

Why do I get No Module Named Tensorflow Error?

There is no other reason for the No Module Named Tensorflow error other than missing module files. The main problem arises when you’re using multiple python versions and their virtual environment. Keep in mind that, Anaconda, PyCharm, Jupyter, and Spyder have their own virtual environment and it’s tricky to install modules in that environment.

Causes of No Module Named Tensorflow Error

There are some known causes of this ModuleNotFoundError. As Python lets you handle these errors easily, you can debug them quickly. Following are the cause of the No Module Tensorflow error –

Module Not Installed

If you haven’t installed TensorFlow yet and tried importing TensorFlow in code, then it’ll throw this error. Modules are managed by ‘pip’ which is a package management system for your python. Most of the time, the users forget to tick Add Python to the PATH option while installing it. This creates problems in managing the modules.

Supporting Module Not Installed

Tensorflow has many other supporting modules like numpy, scipy, jupyter, matplotlib, pillow, and scikit-learn. If any of these modules is absent, then it’ll throw an error. Make sure that these modules exist in your library.

Moreover, there are other supporting TensorFlow modules like, tensorflow-addons, tensorflow.contrib which might be absent from your library leading to this error.

Tip: To check which libraries are installed in your environment, enter pip list on your console.

Working on Different Virtual Environment

Virtual Environment: Method by which you isolate your working Python environment from the globally installed Python. This environment has its own installation directories and doesn’t share the libraries from globally installed Python.

Many of the code editors in Windows come with their own virtual environment. Each of these environments acts independently to global python installation and is started with blank external modules. Many times, you install a module but it’s installed on global python, not the python from your virtual environment. This can lead to ModuleNotFoundError No Module named Tensorflow in the code execution.

Code editors namely, Anaconda, Jupyter, and Spyder have their own virtual environment. If you have a similar case, head over to the corresponding solution for each code editor.

Solutions for No Module Named Tensorflow

Following are the solutions for this error in each code editor and OS –

Windows

No Module Tensorflow Windows

In Windows, the path-related issues harras the programmers all the time. As you have limited functionality over the terminal, you’re constantly facing with ModuleNotFoundError error. To install TensorFlow in your Windows, make sure you follow these steps –

  1. Uninstall existing python versions to avoid any conflicts.
  2. Go to Python.org and install the Python setup. Make sure you install the 64-bit version. Unfortunately, Tensorflow is not supported in 32 bit systems.
  3. Open the installer and select the “Add Python x.x to your PATH” option. This will ensure, that python executes from the path.
  4. After installing, open the command terminal or PowerShell and enter the command pip install tensorflow in it.
  5. Wait for it to finish the installation and run your python file by command python file.py

Linux

In Linux, it’s relatively easier to install TensorFlow. First of all, check if you are working on a virtual environment by a command which python. This command will return the path of python which you’re going to execute. If you are in a virtual environment, either leave the environment directory or enter the command deactivate to deactivate the virtual environment.

Note: Please do not try to uninstall python in Linux as it’ll interfere with your GDM (Graphical Display Manager). Instead, install a new version and then create your own virtual environment.

Follow these steps to install Tensorflow in Linux –

sudo pip3 install tensorflow

Mac

In Mac, No Module named Tensorflow is a persistent error because of environment errors. If you are working on your virtual environment, you need to deactivate and activate it again. Then use the pip list command to check if the TensorFlow module exists in your library. If not, then use the pip3 install tensorflow to install TensorFlow.

Anaconda

No Module Named Tensorflow in Anaconda

If you’re using Anaconda and you face no module named Tensorflow error, then you probably haven’t installed TensorFlow in the conda environment. As anaconda has a different environment than your default python environment, you need to install TensorFlow in it. To do it follow these steps –

  1. Open Anaconda Prompt on your computer.
  2. Enter the command conda install tensorflow in it.
  3. Wait for the installation to complete and restart the conda shell and run your program.

Jupyter

If you’ve installed Juptyter Notebook from Anaconda, it’ll use a conda environment. By default, the libraries in this environment need to be installed via command. To do the same, open your Conda Prompt and enter the command conda install tensorflow. This will ensure that your Juptyer Notebook has TensorFlow in it.

If your Jupyter is not installed via Anaconda, then use the pip install tensorflow to install the TensorFlow module. This will resolve the error ModuleNotFoundError No module named Tensorflow instantly.

Spyder

Spyder is installed via Anaconda which operates an Anaconda environment. Simply use the command conda install tensorflow in your Anaconda Prompt to install TensorFlow.

PyCharm

PyCharm is a special application that operates in its own virtual environment. Due to the unavailability of the TensorFlow error, you can face the no module found error. Follow these steps to install TensorFlow –

  1. Press Settings and select the Project Interpreter tab under projects.
  2. Now enter Tensorflow in the box and install it.
  3. After installing the package, your error will be resolved.

Supporting ModuleNotFoundError for Tensorflow

Tensorflow has many addons which come in handy to avoid writing long code. These addons and contributions are added separately in other packages and combine with the original TensorFlow module. Following are the examples of ModuleNotFoundError –

No module named ‘tensorflow.contrib’

Unfortunately, the contrib module in TensorFlow is not included in version 2.0. If you still want to use the contrib module, you’ll have to install the previous version of TensorFlow. Follow these steps –

pip uninstall tensorflow
pip install tensorflow==1.13.2

No module named ‘tensorflow_addons’

Use pip install tensorflow-addons to install the addons for TensorFlow.

No Module Named Tensorflow Still Not Resolved?

If you’ve tried all the methods and were still not able to solve the issue then, there might be some hardware limitations. Tensorflow requires Python 3.5-3.7, 64-bit system, and pip>=19.0. If you’re unable to fulfill these hardware + software requirements, then don’t worry, we still have a solution for you!

Google released a free product named ‘Colab‘ in 2018. Colab allows you to run and test machine learning models online. To explain more, it’s a replica of the jupyter notebook with all modules installed. To use Tensorflow in Google Colab follow these steps –

  1. Sign in to your Google account.
  2. Open Colab in your browser.
  3. Create a new Jupyter Notebook. (This notebook will be saved in your google drive).
  4. Type your code and run it.

Using Tensorflow in Colab

Colab has many libraries like TensorFlow, numpy, pandas, etc pre-installed in its shell. Make sure you make good use of it.

Tip: Do not use Colab to store/process peer-to-peer files. This may result in a ban!

See Also

Conclusion

Tensor flow has a flexible architecture. The easy deployment of the code makes it special in nature. However, we have to be very careful before using it. Any small syntax error can result in incorrect importing of the library.

На чтение 5 мин. Просмотров 90 Опубликовано 14.04.2021

Tensorflow – это платформа для искусственного интеллекта с открытым исходным кодом, которая включает обширные библиотеки и ресурсы сообщества, которые позволяют исследователям продвигать новейшие достижения в машинном обучении и инженерам. эффективно создавать и встраивать приложения, управляемые с помощью машинного обучения, в микроконтроллеры и микропроцессоры. Компьютерные фанаты могут легко установить Python и PyCharm в свои системы, но при попытке установить Tensorflow они сталкиваются с сообщением об ошибке: «Не удалось найти версию, удовлетворяющую требованию TensorFlow (из версий:) Нет соответствия Распределение найдено для TensorFlow ». Многие люди установили Flask, чтобы избавиться от этой проблемы, но, следовательно, они не могут этого сделать. Помня об этом, я собрал несколько возможных решений этой проблемы и следую этому руководству, чтобы избавиться от этой ошибки.

Как оказалось, есть несколько разных причин, которые могут в конечном итоге вызвать эту проблему, поэтому давайте перейдем шаг вперед и протестируйте некоторые исправления, пока мы не сможем устранить этот сбой в Windows.

Содержание

  1. Метод 1: проверка Python Версия в вашей системе
  2. Метод 2: Понизьте версию Python на Anaconda
  3. Метод 3: Обновить установщик пакетов для Python

Метод 1: проверка Python Версия в вашей системе

Если вы используете Windows 10 с версией Python 3.6.X в вашей системе, то, скорее всего, 32-битная версия Python могла бы работать на 64-битной машине. Имейте в виду, что TensorFlow совместим только с 64-битной установкой python, а не с 32-битной версией python. Если вы загрузили Python с python.org , установка по умолчанию будет 32-битной, поэтому, чтобы избавиться от этой проблемы, скачайте 64-битный установщик отсюда. Теперь нам нужно установить переменную среды PATH , потому что в ней перечислены каталоги, в которых будет производиться поиск исполняемых файлов при вводе команды в командной строке. Добавив путь к исполняемому файлу Python, вы сможете получить доступ к python.exe , набрав ключевое слово python (вам не нужно указывать полный путь к программе). Если переменная PATH не установлена, возникает следующая ошибка:

 C: > python'python 'не распознается как внутренняя или внешняя команда, работающая программа или командный файл. 

Как видите, команда не была найдена, следовательно, для запуска python.exe , вам необходимо указать полный путь к исполняемому файлу, следовательно, указать полный путь к переменной, выполните шаги, указанные ниже:

  1. Щелкните правой кнопкой мыши на “Мой компьютер”, а затем нажмите кнопку Свойства .
  2. Вкл. В левой части окна найдите Расширенные настройки системы, и после нажатия на него вы увидите, что откроется окно Свойства системы .
  3. Теперь найдите параметр переменной PATH и нажмите Изменить.. Поместите курсор в конец строки Variable value и добавьте путь к файлу python.exe, которому предшествует точка с запятой (;). В моем случае я добавил следующее значение: C: Python36, потому что я хочу запустить версию Python 3.6.
  4. Закройте все окна и найдите командную строку. В командном окне введите следующую команду и нажмите Enter. Вы увидите, что теперь в вашей системе присутствует 64-битная версия, и теперь я попытаюсь установить TensorFlow и проверить, сохраняется ли ошибка:
     C: > python --versionPython 3.7.6  (по умолчанию, 8 января 2020 г., 20:23:39) [MSC v.1916, 64 бит (AMD64)] 
  5. Выполните следующую команду, чтобы установить TensorFlow в вашей системе и, надеюсь, сейчас установка будет продолжена без сообщений об ошибках. Примечание: TensorFlow еще не находится в репозитории PyPI, поэтому вам необходимо указать URL-адрес соответствующего «файла колеса» для вашей операционной системы и версии Python.
     pip install -  -обновите https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

Метод 2: Понизьте версию Python на Anaconda

Tensorflow поддерживает только Python 3.6.x и только 64-битную версию. Следовательно, если вы используете графический интерфейс, такой как anaconda, и python 3.7 установлен на нем по умолчанию, следовательно, мы должны понизить его до 3.6, чтобы установить Tensorflow. Для выполнения этой задачи выполните указанные ниже команды в командной строке Anaconda:

 conda install python = 3.6.4 

После выполнения этой команды подождите пару секунд и затем создайте виртуальную среду для установки Tensorflow. Назовите виртуальную среду, например, «ab», а затем установите текущую версию TensorFlow только для ЦП:

 conda create -n ab tensorflowconda activate tf 

После понижения версии Версия python, Tensorflow теперь будет установлен без каких-либо ошибок, и даже если вы установили настольную версию Ubuntu, он будет работать и для этого.

Метод 3: Обновить установщик пакетов для Python

Pip – это установщик пакетов для Python, и мы можем использовать pip для установки пакетов из индекса пакетов Python и других индексов. Хотя обновления выпускаются регулярно через три месяца, и эти пакеты необходимо обновить вручную в вашей системе, выполнив определенные команды. Если они не устарели, они могут вызвать эту ошибку установки Tensorflow, поэтому мы обновим пакет pip, выполнив следующие команды ниже, чтобы все пакеты обновились автоматически:

 pip install --upgrade pippip  install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

После обновления пакетов pip, надеюсь, ваш установка пройдет гладко, и теперь вы сможете разрабатывать интересные программные проекты с помощью Tensorflow..

Обход проблемы. Возможно, не существует версии TensorFlow, совместимой с вашей версией Python. Это особенно верно, если вы используете новую версию Python. Например, может быть задержка между выпуском новой версии Python и выпуском TensorFlow для этой версии Python. В этом случае я считаю, что упомянутые выше параметры, такие как переход на предыдущую версию Python, компиляцию TensorFlow из исходного кода и ожидание выпуска соответствующей версии TensorFlow, являются всеми возможными средствами, которые могут позволить вам установить Tensorflow на ваша система без сбоев.

Понравилась статья? Поделить с друзьями:
  • Pioneer mvh a200vbt error 10
  • Pioneer mvh 210bt error 10
  • Pioneer mvh 150ui ошибка 19
  • Pioneer mvh 150ub amp error
  • Pip install sklearn error