1

I want to run pipenv install on my ubuntu machine with python3.10 but I get those errors when running the command:

Installing dependencies from Pipfile.lock (17eb3b)...
Traceback (most recent call last):▉▉▉▉▉ 0/25 — 00:00:00
  File "/root/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/pipenv/cli/options.py", line 56, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 241, in install
    site_packages=state.site_packages,
  File "/root/.local/lib/python3.6/site-packages/pipenv/core.py", line 2102, in do_install
    keep_outdated=keep_outdated,
  File "/root/.local/lib/python3.6/site-packages/pipenv/core.py", line 1343, in do_init
    pypi_mirror=pypi_mirror,
  File "/root/.local/lib/python3.6/site-packages/pipenv/core.py", line 870, in do_install_dependencies
    project, normal_deps, procs, failed_deps_queue, requirements_dir, **install_kwargs
  File "/root/.local/lib/python3.6/site-packages/pipenv/core.py", line 782, in batch_install
    use_pep517=use_pep517,
  File "/root/.local/lib/python3.6/site-packages/pipenv/core.py", line 1519, in pip_install
    include_hashes=not ignore_hashes,
  File "/root/.local/lib/python3.6/site-packages/pipenv/core.py", line 1438, in write_requirement_to_file
    line = requirement.line_instance.get_line(
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2553, in line_instance
    self.line_instance = self.get_line_instance()
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2547, in get_line_instance
    return Line(line)
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 171, in __init__
    self.parse()
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1289, in parse
    self.parse_extras()
  File "/root/.local/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 577, in parse_extras
    self.line, extras = pip_shims.shims._strip_extras(self.line)
TypeError: 'NoneType' object is not callable
     ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/25 — 

For more information, I did run pipenv --python /usr/bin/python3.10 before that because the projects is running and build on python3.10.

Any Idea how I can fix this error?

sirzento
  • 537
  • 1
  • 5
  • 23

1 Answers1

1

Somebody got the same error. It looks like problem happen with pip18.1 . So at first with run:

pipenv run pip --version

you can see your pip version and then if pipenv locking 18.1 of pip run one of the below commands:

pipenv run python -m pip install -U pip==18.0

or

pipenv run pip install pip==18.0

and after that you can probably run pipenv install successfully.

You can see more discussions for this issue in [Running pipenv gives TypeError: 'module' object is not callable].

Javad
  • 2,033
  • 3
  • 13
  • 23
  • It prints me this line: `pip 21.3.1 from /root/.local/share/virtualenvs/myProject-o9T4z5yw/lib/python3.6/site-packages/pip (python 3.6)`. It says python 3.6 in here. I thought the one command I did run changed the python version to 3.10 – sirzento Aug 03 '22 at 09:07
  • pip version is 21.3.1 and python is 3.10.6. They already where at the latest version – sirzento Aug 03 '22 at 09:29
  • i realised you need to remove the virtual env also, cause the wrong Python version is still being used. In my case mine is in the project directory, so I did `rm -rf .venv/` – cryanbhu Jul 18 '23 at 19:49
  • this is why sometimes i just develop locally with Docker too :/ – cryanbhu Jul 18 '23 at 19:50