-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update pip and conda requirements to fix error on install #328
Conversation
…ter repo install After installing the code in the repo according to steps in the README.md file, an error occurs when running the server with the command $ python microsetta_interface/server.py Error: ImportError: cannot import name 'final' from 'typing' (/usr/local/anaconda3/envs/microsetta-interface_test/lib/python3.7/typing.py) The error encountered occurs because the final feature was introduced in Python 3.8 and is not available in Python 3.7. The error occurs in async_timeout which depends on redis. The version of redis installed is 5.0.7. On the pypi page for redis, at https://pypi.org/project/redis/, this statement is found: ** Note: ** redis-py 5.0 will be the last version of redis-py to support Python 3.7, as it has reached end of life. redis-py 5.1 will support Python 3.8+. Uninstalling redis and installing redis==4.6.0 fixes the error when starting the server. Used pip list and conda list to update the versions in pip_requirements.txt and conda_requirements.txt. Keeping the same packages in each requirement file with the updated versions resulted in an error with a fresh install and running the server. To fix the error, removed redis==4.6.0 from conda_requirements.txt because conda could not find this version of redis and put it in the pip_requirements.txt file. Also needed to add babel as a package to conda_requirements.xt since there was a ModuleNotFoundError for babel. Update flask-babel=2.0.0 in conda_requirements.txt to flask-babel==2.0.0 replace a single = to a double =. Remove pytest==5.3.3 from conda_requirements.txt since it is already in pip_requirements.txt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust this to only pin the version of redis based on your discovery of the incompatibility with a newer version. Changing versions of other packages has potentially deleterious consequences.
Pin only the redis package. Set the version to 4.6.0 in pip_requirements.txt to fix error when running the server after an install Remove redis from conda_requirements.txt and place in pip_requirements.txt because conda can't locate the redis version 4.6.0. Remove pytest from conda_requirements.txt because it was not versioned and there is a versioned pytest < 5.3.4 in pip_requirements.txt. Add an equal sign to "flask-babel=2.0.0" in conda_requirements.txt to set the version using double equal signs.
conda currently has redis-server and not redisredis-server is new for about the past 3 years on conda-forge redis exists via pipthe pip redis version 4.6.0 is dated 6/25/2023 search for redis-server and redis versions on conda-forgeconda search redis-server --channel conda-forge Loading channels: done Name Version Build Channel newest version of 7.4.0 and oldest version of redis-server 6.2.5 give an error when running microsetta-interface server conda search redis --channel conda-forge redis 3.5.3 pyhd3eb1b0_0 pkgs/main both redis and redis-server versions from conda-forge failedwith error But if install redis via pip with version 4.6.0,the microsetta-interface server runs without an error but redis-server wasn't installed via conda or pip. It exists because of a mac install.To install redis-server via pip, install version 6.0.9 (10/30/2020), the most recent version on pip |
Fix error that occurs while running the microsetta-interface server after a fresh install of the repo
Reproduce the error by installing microsetta-interface following the README.md install instructions
After the microsetta-interface is installed in editable mode
Run the Test server
Error message occurs after running microsetta-interface server command
Look at ImportError about 'typing'
The error encountered occurs because the final feature was introduced in Python 3.8 and is not available in Python 3.7.
The error occurs in async_timeout
Get the version of async_timeout
$ pip show async-timeout
Get the version of redis
$ pip show redis
Go to pypi page for redis: https://pypi.org/project/redis/
Try installing redis-py 5.0 and not 5.0.7 and run start server command
Still get the errors
Fix for no errors
Install redis 4.6.0
Run the Test server
Now there is no error, and the server starts
Find the versions of packages to update the original pip requirements
List the updated pip installed packages
Include redis==4.6.0 in pip requirements since it is not found with conda (get a PackagesNotFoundError)
Save these packages and versions to the file pip_requirements_updated.txt
List the updated conda installed packages
Find the versions of packages to update the previous conda requirements. Note redis is removed from the conda requirements
Save these packages and versions to file conda_requirements_updated.txt
Delete the conda environment microsetta-interface and create it using the updated requirements
Install updated pip requirements
Then install the microsetta-interface in editable mode:
Get an error after this command
ModuleNotFoundError: No module named 'babel'
Fix is to install babel
Get the version of babel with conda list
Add babel==2.14.0 to conda_requirements_updated.txt
Update flask-babel=2.0.0 in conda_requirements_updated.txt to flask-babel==2.0.0
Remove pytest==5.3.3 from conda_requirements_updated.txt since it is already in pip_requirements_updated.txt
Delete the conda environment and recreate it using the updated requirements
Follow the steps above for deleting the environment, installing packages, and installing code
Run the Test server
Now it works
Running pytest also works
Replace old requirements content with the updated content
Copy contents of updated requirements into their respective files: pip_requirements.txt and conda_requirements.txt