Open biplav-s opened 3 years ago
Hey @biplav-s i too am facing the same issue when installing aix360==0.2.1, i tried creating an env with python3.6 and i was successfully able to install tensorflow==1.14, but it also has a torch dependency which is only available in pythonversions>=3.6.2 in which tensorflow==1.14 is not there.
https://github.com/Trusted-AI/AIX360/issues/126
i tried python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl
for the error of tensorflow==1.14.0 not found
If your setup.py script is looking for libraries outside the Python 3.6 environment, there are a few potential reasons for this behavior. Here are some steps you can take to troubleshoot and address the issue:
Check Python Version Compatibility: Ensure that the libraries you are using in your project are compatible with Python 3.6. Some libraries may require a higher version of Python, and if your setup.py script is attempting to install them in a Python 3.6 environment, it might lead to issues. Update Python: Consider updating your Python version to a more recent one, especially if the libraries you are using have dropped support for Python 3.6. You can use a virtual environment to manage Python versions for your project.
bash
python3.6 -m venv myenv
source myenv/bin/activate # On Linux/macOS
myenv\Scripts\activate # On Windows
pip install -r requirements.txt Review Dependencies: Check your requirements.txt file or any other dependency file for specific version requirements. Make sure that the versions specified are compatible with Python 3.6. Explicitly Specify Python Version in setup.py: In your setup.py file, you can include a python_requires argument to specify the required Python version. For example:
python setup(
python_requires='>=3.6,<3.7',
) This helps ensure that the package is only installed in Python environments that meet the specified version requirements. Consider using tox for Testing: If you want to test your package against multiple Python versions, you can use a tool like tox. tox can create virtual environments for different Python versions and run your tests in each. This can help identify compatibility issues. Check for Environment Variables: Sometimes, issues might arise if there are conflicting environment variables affecting the Python interpreter's behavior. Check for any environment variables that might be influencing the Python environment. Check Installation Log/Error Messages: When you encounter issues during the installation process, review the error messages or logs. They often provide valuable information about what went wrong. By addressing these points, you should be able to identify and resolve the issue with your setup.py script looking for libraries outside the Python 3.6 environment.
@biplav-s Try again. ("I'm unable to recreate the installation errors mentioned ... on mac.")
"conda create --name aix360 python=3.6 conda activate aix360"
Then we do clone without issue "git clone https://github.com/Trusted-AI/AIX360 "
Now we setup dependencies "pip install -e ."
However, the setup.py is looking and installing outside the 3.6 environment it seems. Error below.
Preparing metadata (setup.py) ... done Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.9/site-packages (from aix360==0.2.1) (1.1.0) Requirement already satisfied: scikit-learn>=0.21.2 in /usr/local/lib/python3.9/site-packages (from aix360==0.2.1) (1.0.1) Requirement already satisfied: torch in /usr/local/lib/python3.9/site-packages (from aix360==0.2.1) (1.10.0) Requirement already satisfied: torchvision in /usr/local/lib/python3.9/site-packages (from aix360==0.2.1) (0.11.1) Collecting cvxpy==1.0.31 Using cached cvxpy-1.0.31.tar.gz (947 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: cvxopt in /usr/local/lib/python3.9/site-packages (from aix360==0.2.1) (1.2.7) Requirement already satisfied: Image in /usr/local/lib/python3.9/site-packages (from aix360==0.2.1) (1.5.33) ERROR: Could not find a version that satisfies the requirement tensorflow==1.14 (from aix360) (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.5.1, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.7.0rc0, 2.7.0rc1) ERROR: No matching distribution found for tensorflow==1.14
A hack to overcome this error was to install tensorflow manually. Example: python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
But when we can go to examples/tutorials and try HELOC notebook aix360 is not found
Even if we do (!pip install aix360) to install within the conda python 3.6 environment, the installation does not help.
Is setup.py broken?
I tried on another Mac where I had python=3.7 installed and there was no problem.