-1

An error occurs after running python3 -m pip install --upgrade setuptools

error code like this:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\Administrator\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python312\\site-packages\\pkg_resources\\tests\\data\\my-test-package_unpacked-egg\\my_test_package-1.0-py3.7.egg\\EGG-INFO\\dependency_links.txt'

i did pip install setuptools

and i did python setup.py sdist bdist_wheel in setup.py directory

here i got an error like this ModuleNotFoundError: No module named 'setuptools'

After Googling, I found that using this command solved the problem. python3 -m pip install --upgrade setuptools but it is not working with error

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\Administrator\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python312\\site-packages\\pkg_resources\\tests\\data\\my-test-package_unpacked-egg\\my_test_package-1.0-py3.7.egg\\EGG-INFO\\dependency_links.txt'

i don't use dependency_links in setup.py

what's the problem?

1
  • 3
    It looks like you installed as admin, but are likely no running the script as admin (note the Administrator in the install path). Put a virtual environment in a place where all users can access it. Alternatively, if you need to use a global environment (in most cases I would not recommend it), install Python and the package for all users. Commented Aug 11, 2024 at 23:01

2 Answers 2

0

Had the same issue. I did a fresh install of anaconda, and suddenly everything worked fine. https://www.anaconda.com

Sign up to request clarification or add additional context in comments.

Comments

0

I have similar problem when I tried to create my virtual env.

What I did to resolve the problem is simply uninstall virturalenv and re-install the latest version.

Before uninstall, my computer is running virtualenv 20.17.1

After re-install, it is upgrade to virtualenv 20.26.6

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.