Installation issue on WSL
Opened this issue · 2 comments
xxcc197 commented
Will this project run on wsl, my six can't fully install dependencies and there are a lot of package conflicts after pip check
pip check
ml-dtypes 0.2.0 has requirement numpy>1.20, but you have numpy 1.19.2.
flask 3.0.3 has requirement click>=8.1.3, but you have click 7.1.2.
flask 3.0.3 has requirement Jinja2>=3.1.2, but you have jinja2 2.11.3.
flask 3.0.3 has requirement Werkzeug>=3.0.0, but you have werkzeug 1.0.1.
Then I run my check script
import pkg_resources
def parse_requirements(filename):
with open(filename, 'r') as file:
lines = file.readlines()
requirements = []
for line in lines:
line = line.strip()
if line and not line.startswith('#'):
requirements.append(line)
return requirements
def get_installed_packages():
installed_packages = {pkg.key: pkg.version for pkg in pkg_resources.working_set}
return installed_packages
def main():
requirements = parse_requirements('requirements.txt')
installed_packages = get_installed_packages()
missing_packages = []
version_mismatched_packages = []
for req in requirements:
if '@' in req:
continue
if '==' in req:
pkg_name, pkg_version = req.split('==')
else:
pkg_name = req
pkg_version = None
installed_version = installed_packages.get(pkg_name.lower())
if installed_version is None:
missing_packages.append(pkg_name)
elif pkg_version and installed_version != pkg_version:
version_mismatched_packages.append((pkg_name, pkg_version, installed_version))
if missing_packages:
print("Missing packages:")
for pkg in missing_packages:
print(f"- {pkg}")
if version_mismatched_packages:
print("\nVersion mismatched packages:")
for pkg_name, required_version, installed_version in version_mismatched_packages:
print(f"- {pkg_name}: required {required_version}, installed {installed_version}")
if not missing_packages and not version_mismatched_packages:
print("All packages are installed and match the required versions.")
if __name__ == "__main__":
main()
python3 1.py
Version mismatched packages:
- six: required 1.15.0, installed 1.15.0
Reinstalling these related packages didn't help
xxcc197 commented
my wsl is Ubuntu 22.04.3 LTS
rongakowang commented
Hi,
I haven't tested on WSL, but in general your package conflicts above should not block the installation. Latest numpy may have problems, but the exact version of other packages you show above should not matter.
How about just fix the numpy version and re-install others via pip?