Pipenv not working after upgrade to python (Homebrew installed) - python

It appears pipenv and other python packages on my Mac are tied to Python 3.6 but should work fine with 3.7. I recently updated to python via
brew upgrade python
Running 3.7.0
$ pipenv update
Warning: Python 3.6 was not found on your system…
You can specify specific versions of Python with:
$ pipenv --python path/to/python
When I try to specify the path... I get:
```
$ pipenv --python 3.7 update
Creating a virtualenv for this project…
Pipfile: /Users/zane/src/dinghy-ping/Pipfile
Using /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/bin/python3.7 (3.7.0) to create virtualenv…
⠸Running virtualenv with interpreter /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/bin/python3.7
Using base prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7'
/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv.py:1041: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
New python executable in /Users/zane/.local/share/virtualenvs/dinghy-ping-ePAjWOtt/bin/python3.7
Not overwriting existing python script /Users/zane/.local/share/virtualenvs/dinghy-ping-ePAjWOtt/bin/python (you must use /Users/zane/.local/share/virtualenvs/dinghy-ping-ePAjWOtt/bin/python3.7)
Please make sure you remove any previous custom paths from your /Users/zane/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
Complete output from command /Users/zane/.local/s...AjWOtt/bin/python3.7 - setuptools pip wheel:
Looking in links: /usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages, /usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv_support, /Users/zane/Library/Python/3.7/lib/python/site-packages/virtualenv_support
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/96/06/c8ee69628191285ddddffb277bd5abdf769166e7a14b867c2a172f0175b1/setuptools-40.4.3-py2.py3-none-any.whl
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/5a/9b/6aebe9e2636d35d1a93772fa644c828303e1d5d124e8a88f156f42ac4b87/wheel-0.32.2-py2.py3-none-any.whl
Installing collected packages: setuptools, pip, wheel
Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted: '/bin/easy_install'
```
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv.py", line 2343, in
main()
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv.py", line 712, in main
symlink=options.symlink)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv.py", line 947, in create_environment
download=download,
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv.py", line 904, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/virtualenv.py", line 796, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/zane/.local/s...AjWOtt/bin/python3.7 - setuptools pip wheel failed with error code 1
```
```
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/bin/pipenv", line 11, in
load_entry_point('pipenv==2018.10.13', 'console_scripts', 'pipenv')()
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1134, in invoke
Command.invoke(self, ctx)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/cli/command.py", line 203, in cli
clear=state.clear,
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/core.py", line 565, in ensure_project
pypi_mirror=pypi_mirror,
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/core.py", line 500, in ensure_virtualenv
python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/core.py", line 901, in do_create_virtualenv
click.echo(crayons.blue("{0}".format(c.err)), err=True) File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/delegator.py", line 146, in err
return self._pexpect_out
File "/usr/local/Cellar/pipenv/2018.10.13/libexec/lib/python3.7/site-packages/pipenv/vendor/delegator.py", line 114, in _pexpect_out
result += self.subprocess.after
TypeError: can only concatenate str (not "type") to str
```
The problem seems to be with:
Installing collected packages: setuptools, pip, wheel
Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted: '/bin/easy_install'

Related

pip-compile error using Anaconda - File "/opt/anaconda3/bin/pip-compile", line 8, in <module> sys.exit(cli())

My pip version is 22.0.4. I had the most recent version but had to downgrad because I noticed the same error mentioned here: https://github.com/jazzband/pip-tools/issues/1617)
When I try to run pip-compile to update the requirements.txt file but I keep seeing the below error:
(base) krs#me-user ds-airflow % pip-compile
WARNING:pip._internal.metadata.base:Ignoring invalid distribution -rllib3 (/opt/anaconda3/lib/python3.8/site-packages)
WARNING:pip._internal.metadata.base:Ignoring invalid distribution -otocore (/opt/anaconda3/lib/python3.8/site-packages)
WARNING:pip._internal.metadata.base:Ignoring invalid distribution -ix (/opt/anaconda3/lib/python3.8/site-packages)
WARNING:pip._internal.metadata.base:Ignoring invalid distribution - (/opt/anaconda3/lib/python3.8/site-packages)
Traceback (most recent call last):
File "/opt/anaconda3/bin/pip-compile", line 8, in <module>
sys.exit(cli())
File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/piptools/scripts/compile.py", line 313, in cli
repository = PyPIRepository(pip_args, cache_dir=cache_dir)
File "/opt/anaconda3/lib/python3.8/site-packages/piptools/repositories/pypi.py", line 93, in __init__
self._setup_logging()
File "/opt/anaconda3/lib/python3.8/site-packages/piptools/repositories/pypi.py", line 451, in _setup_logging
assert isinstance(handler, logging.StreamHandler)
AssertionError
EDIT: I just tried running: pip-compile --upgrade
File "/opt/anaconda3/bin/pip-compile", line 8, in <module>
sys.exit(cli())
File "/opt/anaconda3/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/anaconda3/bin/python3', '/opt/anaconda3/lib/python3.8/site-packages/pep517/in_process/_in_process.py', 'get_requires_for_build_wheel', '/var/folders/2b/d94v_0s54rxfx2ylxg20xh5c0000gn/T/tmp2o517hrt']' returned non-zero exit status 1.
EDIT EDIT:
I've run conda list '(pip|click)' and see the following, but my requirements.txt file has hundreds of packages:
# packages in environment at /opt/anaconda3:
#
# Name Version Build Channel
click 7.1.1 pypi_0 pypi
click-default-group 1.2.2 pypi_0 pypi
clickclick 20.10.2 pypi_0 pypi
pip 20.2.4 pypi_0 pypi
pip-tools 6.6.0 pypi_0 pypi
The version combination of pip=20.2.4 and pip-tools=6.6.0 is not compatible. Either upgrade pip to >=21.2, or downgrade pip-tools to 5.5.

Is Colorama required for Flask or Click?

I'm trying to do the Flask "Hello World" tutorial and when I do the 'flask run' command on terminal I get the following traceback:
PS C:\Users\boymeetscode\PycharmProjects\beerRPG> flask run
Traceback (most recent call last):
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\Scripts\flask-script.py", line 9, in <module>
sys.exit(main())
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\flask\cli.py", line 990, in main
cli.main(args=sys.argv[1:])
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\flask\cli.py", line 596, in main
return super().main(*args, **kwargs)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\core.py", line 1062, in main
rv = self.invoke(ctx)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\flask\cli.py", line 844, in run_command
show_server_banner(get_env(), debug, info.app_import_path, eager_loading)
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\flask\cli.py", line 678, in show_server_banner
click.echo(f" * Environment: {env}")
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\utils.py", line 294, in echo
file = auto_wrap_for_ansi(file) # type: ignore
File "C:\Users\boymeetscode\miniconda3\envs\beerRPG\lib\site-packages\click\_compat.py", line 541, in auto_wrap_for_ansi
import colorama
ModuleNotFoundError: No module named 'colorama'
I am on Windows, Python 3.9.7 and did the pip install flask in my venv so if colorama is a dependency I would expect that it would have been installed automatically. Why isn't it?
Update: I manually installed colorama and now Flask works. I'm just still confused why if this is a dependency it wasn't installed automatically. My pip install didn't appear to return any errors.
Can confirm something in conda or click broke recently: colorama is missing after installing click (which was installed for black in my case). I use conda environment files so instead of manually installing I added a more recent version with
- conda-forge::click
in the .yml file.
Then conda update installed click 8.03 and colorama, over click 8.0.1 which I had. Without an env file conda install -c conda-forge click should do the trick.
I do not know what exactly fixed it though, it is not in click's release notes: though there was arecent change to always install colorama, that was in version 8.0.0.

I don't know what is happening when is tried to upgrade pip fro 20.2.2 to 20.2.3 is showing errors

C:\Users\sulav>python get-pip.py
python: can't open file 'get-pip.py': [Errno 2] No such file or directory
C:\Users\sulav>python -m pip install -U pip
Collecting pip
Using cached pip-20.2.3-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.2
Uninstalling pip-20.2.2:
Successfully uninstalled pip-20.2.2
Rolling back uninstall of pip
Moving to c:\users\sulav\appdata\roaming\python\python37\scripts\pip.exe
from C:\Users\sulav\AppData\Local\Temp\pip-uninstall-plw0b_z7\pip.exe
Moving to c:\users\sulav\appdata\roaming\python\python37\scripts\pip3.7.exe
from C:\Users\sulav\AppData\Local\Temp\pip-uninstall-plw0b_z7\pip3.7.exe
Moving to c:\users\sulav\appdata\roaming\python\python37\scripts\pip3.exe
from C:\Users\sulav\AppData\Local\Temp\pip-uninstall-plw0b_z7\pip3.exe
Moving to c:\users\sulav\appdata\roaming\python\python37\site-packages\pip-20.2.2.dist-info\
from c:\users\sulav\appdata\roaming\python\python37\site-packages\~ip-20.2.2.dist-info
Moving to c:\users\sulav\appdata\roaming\python\python37\site-packages\pip\
from c:\users\sulav\appdata\roaming\python\python37\site-packages\~ip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
status = self.run(options, args)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
return func(self, options, args)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\commands\install.py", line 421, in run
pycompile=options.compile,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\__init__.py", line 90, in install_given_reqs
pycompile=pycompile,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 821, in install
requested=self.user_supplied,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\operations\install\wheel.py", line 860, in install_wheel
requested=requested,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\operations\install\wheel.py", line 762, in _install_wheel
generated_console_scripts = maker.make_multiple(scripts_to_generate)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 418, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\operations\install\wheel.py", line 498, in make
return super(PipScriptMaker, self).make(specification, options)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 407, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 307, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 242, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 386, in _get_launcher
raise ValueError(msg)
ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\sulav\AppData\Local\Programs\Python\Python37\python.exe -m pip install --upgrade pip' command.
You need to download get-pip.py and make sure that you are in that directory when you are trying to install it. For instance i see that the dirctory you are in is C:\Users\sulav> make sure that it is downloaded to this directory.

Python Error when installing ruamel.yaml package with pip

I am receiving an error when I want to install the ruamel.yaml package
Here is the command:
python --version;pip --version;pip install ruamel.yaml
And the output:
Python 2.7.10
pip 10.0.0 from /Library/Python/2.7/site-packages/pip (python 2.7)
Collecting ruamel.yaml
Downloading https://files.pythonhosted.org/packages/c1/ad/9557a78f1b61951623c56225e05dacdd81f80519f13fc39a926a5793edfa/ruamel.yaml-0.15.37.tar.gz (280kB)
100% |████████████████████████████████| 286kB 4.4MB/s
Complete output from command python setup.py egg_info:
sys.argv ['-c', 'egg_info', '--egg-base', 'pip-egg-info']
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8j/69k5q3yn4y51g5nt2g7g9b9n24s68p/T/pip-install-htyM8C/ruamel.yaml/setup.py", line 917, in <module>
main()
File "/private/var/folders/8j/69k5q3yn4y51g5nt2g7g9b9n24s68p/T/pip-install-htyM8C/ruamel.yaml/setup.py", line 905, in main
setup(**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 272, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 326, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2385, in require
reqs = self.dist.requires(self.extras)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2617, in requires
dm = self._dep_map
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2606, in _dep_map
if invalid_marker(marker):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1424, in is_invalid_marker
cls.evaluate_marker(text)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1549, in _markerlib_evaluate
env = cls._translate_metadata2(_markerlib.default_environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1537, in _translate_metadata2
for key, value in env
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1536, in <genexpr>
(key.replace('.', '_'), value)
ValueError: too many values to unpack
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8j/69k5q3yn4y51g5nt2g7g9b9n24s68p/T/pip-install-htyM8C/ruamel.yaml/
To give a bit of a background. I installed python3 with brew and I uninstalled it thereafter.
Now I cannot install ruamel.yaml
Has anybody had the same issue?
How did you solve it?
You should do a pip list and check your version of setuptools should be (28.8.0). If you have an older version, upgrade with pip install -U setuptools.
You should consider upgrading from 2.7.10 to a newer version of Python 2 (currently 2.7.14), which should solve your SSL problems. Make sure you don't overwrite the system python if you are running on Linux.
I was able to resolve this by downgrading the python version from 3.10.+ to 3.9.+

InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr1szu/Django/

I'm trying to start a Pinax Project for Django.
I setup my Python Virtual Environment.
Upgraded setup tools.
Upgraded pip.
Installed Pinax.
Then when I tried 'pinax start blog my_site', it gave the following error:
Installing Django...
Traceback (most recent call last):
File "/usr/local/bin/pinax", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 63, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 97, in start
pip_install("Django")
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 23, in pip_install
command.run(opts, [package])
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr1szu/Django/
I've tried making a python virtual environment inside my conda environment. Also tried making a standalone python environment. Neither solved it. Also tried installing django using pip.
Gave the following error:
sudo pip install django
The directory '/home/scarlet/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/scarlet/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting django
Downloading Django-2.0.tar.gz (8.0MB)
100% |████████████████████████████████| 8.0MB 62kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-SNP9W5/django/setup.py", line 32, in <module>
version = __import__('django').get_version()
File "django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "django/utils/version.py", line 61, in <module>
#functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SNP9W5/django/
What would you suggest?
Thank you for the read!
It appears like you are using python 2; if that is correct Django version 2 only supports python 3. Please refer to https://docs.djangoproject.com/en/2.0/releases/2.0/#python-compatibility
You could try installing a lower version of Django:
pip install "Django<2"
you may try:
pip3 install django

Categories

Resources