简体   繁体   中英

How can I fix “ERROR: Command errored out with exit status 1:” when trying to install django-visits

I am trying to install django-visits, but anytime I run the "pip install django-visits" command, I get the following error:

ERROR: Command errored out with exit status 1:
command: 'c:\users\samuel\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-insta
ll-8t2j3cs9\\distribute\\setup.py'"'"'; __file__='"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-8t2j3cs9\\distribute\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fi
le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3c
s9\distribute\pip-egg-info'
         cwd: C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\__init__.py", line 2, in <module>
        from setuptools.extension import Extension, Library
      File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\extension.py", line 5, in <module>
        from setuptools.dist import _get_unpatched
      File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\dist.py", line 7, in <module>
        from setuptools.command.install import install
      File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\command\__init__.py", line 8, in <module>
        from setuptools.command import install_scripts
      File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\command\install_scripts.py", line 3, in <module>
        from pkg_resources import Distribution, PathMetadata, ensure_directory
      File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\pkg_resources.py", line 1518, in <module>
        register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
    AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```


How can I fix it?

Simply try pip3 install django-visits and see if it works. If not, follow the solution below.

I think this is because python3.7 and pip were installed from different sources. I suggest using python's inbuilt facility to install pip ie

python3 -m ensurepip --upgrade

This should install pip3 and pip3.x where x in python3.x .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM