Error executing pip install tfx in new conda environment with python 3.10
HeyPhiS opened this issue · 6 comments
System information
- Have I specified the code to reproduce the issue (Yes, No): Yes
- Environment in which the code is executed: Windows 10
- TFX Version: 1.14
- Python version: 3.10.13
- pip version: 23.3.1
- conda version: 23.10.0
- Python dependencies (from
pip freeze
output): -
- pip freeze output:
None
- pip freeze output:
-
- conda list output:
bzip2 1.0.8
ca-certificates 2023.11.17
libffi 3.4.2
libsqlite 3.44.0
libzlib 1.2.13
openssl 3.1.4
pip 23.3.1
python 3.10.13
setuptools 68.2.2
tk 8.6.13
tzdata 2023c
ucrt 0.0.22621.0
vc 14.3
vc14_runtime 14.36.32532
vs2015_runtime 14.36.32532
wheel 0.41.3
xz 5.2.6
- conda list output:
Describe the current behavior
pip install -U tfx results in error (see below). Install is not completed.
Describe the expected behavior
According to the TFX User guide (https://www.tensorflow.org/tfx/guide) installation of tfx 1.14 under python 3.10 should be possible.
Standalone code to reproduce the issue
conda create -n test_tfx python=3.10
conda activate test_tfx
pip install -U tfx
Other info / logs
_[ pip collection operations for earlier packages work normally ]_
Collecting absl-py<0.9,>=0.7 (from tfx)
Using cached absl-py-0.8.1.tar.gz (103 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
╰─> [6 lines of output]
Traceback (most recent call last):
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\User1\AppData\Local\Temp\pip-install-hwkjnv_r\absl-py_58dfd7d567574ee0a96ad5d1991ce90a\setup.py", line 34, in <module>
raise RuntimeError('Python version 2.7 or 3.4+ is required.')
RuntimeError: Python version 2.7 or 3.4+ is required.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Unfortunately there is currently no plan to support Windows. However, you can install WSL on windows following this guide and set up a virtual Python environment inside your WSL instance. Then you can install TFX in your virtual environment.
Although I tried to pip install TFX in linux machine and got the same error. The installation works in colab environment. Let me take this bug to team internally and meanwhile you can use colab environment for development. Thanks.
This is caused by an old bug in absl-py
that has already been fixed. That fix however happened after version 0.9
, which the log shows to be an upper bound.
After installing the latest nightly and checking my installed packages I only see version 1.4.0
having been installed, so I can't really explain why this happens.
There is also a stack overflow discussion on this.
I hope this helps anyone trying to fix it :)
It worked!
I tried it in a fresh virtual environment on Ubuntu 22.04.3 with Python 3.10, pip 24.0, setuptools 69.5.1 running in WSL 2 and it worked like a charm. (It also worked in miniconda 24.3.0)
From some initial playing around with it, it also seems as though shapely no longer causes any problems, this makes working with tfx so much easier, thank you!
Yep, we have removed the issue with shapely as well. If you need more further assistance feel free to reopen the thread. Hope it works well!