question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot install editable package

See original GitHub issue

I wanted to install a package on a local drive as an editable package under Windows:

D:\projects\myproject>pipenv install -e D:\projects\DjangoApps\mypackage
Describe your environment
  1. OS: Windows 10 Pro, 64 bit
  2. Python version: Python 3.6.1
  3. Pipenv version: pipenv, version 8.3.2
Expected result

the package is listed in Pipfile and myproject finds the mypackage dependency

Actual result

The following error occurs:

Installing -e D:\projects\DjangoApps\mypackage…
Traceback (most recent call last):
  File "c:\program files (x86)\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files (x86)\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python36-32\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\cli.py", line 1880, in install
    converted = convert_deps_from_pip(package_name)
  File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\utils.py", line 547, in convert_deps_from_pip
    os.path.isfile(req.name)) and not req.vcs:
  File "c:\program files (x86)\python36-32\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType  
Solution

I checked the code in pyenv/utils.py and at the line 547, i.e. around:

[...]
  if (req.uri or (os.path.isfile(req.path) if req.path else False) or
        os.path.isfile(req.name)) and not req.vcs:
[...]

the error occurs because req.name is None. Hence the simple solution is check as for req.path:

if (req.uri or (os.path.isfile(req.path) if req.path else False) or
        (os.path.isfile(req.name) if req.name else False)) and not req.vcs:

At least on my pc it worked. The Pipfile looks as follows after installing the editable package:

[packages] … django = “==1.10.5” “-e d:\projects\djangoapps\mypackage” = “*”

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
techalchemycommented, Dec 7, 2017

@chenull pipenv version 9.0 has been released with this fix, so I’m going to close this issue – let us know if there is any further problem!

0reactions
techalchemycommented, Nov 29, 2017

@chenull that should be right, the fix from #958 hasn’t found its way into a release yet since things were in a bit of a freeze due to needing to put together a major release. I suspect we’ll see one soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install --editable does not work as expected for ... - GitHub
Using a normal pip install , this works as expected. But when using pip install -e to install both main_package and some_plugin ,...
Read more >
pip Install Editable Package Produces ModuleNotFoundError
I've been facing similar issues with frappe as well, which installs all its apps in editable mode. However, the problem exists only in...
Read more >
Unable to import a package installed in editable mode? - Reddit
I've run pip list to show the list of installed packages in the virtualenv and it shows up there. I don't understand why...
Read more >
Unresolved references to editable packages (pip install
Currently if you install a site-package in such a way that it creates an .egg-link file pycharm does not recognize it, or add...
Read more >
pip install - pip documentation v22.3.1
Ignore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found