abseil / abseil-py

Abseil Common Libraries (Python)
Apache License 2.0
2.27k stars 246 forks source link

Absl Installation on Virtual Environment #267

Closed Diacod-I closed 8 months ago

Diacod-I commented 8 months ago

Description Hello, I'm trying to install Abseil on a virtual environment for a personal project. I use requirements.txt and I want the . But for some reason, the subprocess for setup.py keeps failing and causing an error. The Gzipped Tar file for it seems to retrieve easily and gets cached into the virtual environment but throws an error on setup. As shown from the output screenshot in the 2nd screenshot under 'Screenshots' after trying to install requirements.txt, it shows on the output, however when trying to run my program, it throws a ModuleNotFoundError for absl as shown in the 5th screenshot under 'Screenshots'.

Environment Windows Power Shell Python Version: 3.11.7 pip Version: 23.2.1

Screenshots

1) Error Message

image

2) Output from !pip list

image

3) Requirements.txt

image

4) Reproducible code

from absl import app
from absl import flags

FLAGS = flags.FLAGS
flags.DEFINE_string("data_set",None,"The data set.")
flags.DEFINE_integer("num_sources", 16, "The number of source graphs.")
flags.DEFINE_integer("num_threads", 32, "The number of threads")
flags.DEFINE_string("working_dir", None, "The working directory")

5) Error on running code

image

yilei commented 8 months ago

You need at least absl-py 0.12.0+. Before that, absl-py's setup.py has a bug checking Python versions for 3.10+.