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.

QUESTION: pipenv "-e ." --dev works same way on pip and pip3?

See original GitHub issue

This looks like a blog post or something but it’s a question, sorry for the verbose…

So I just started the development of a library in order to learn python, coming from a Java/JS envs and used to dependency managers I “discover” pipenv.

Before using pipenv I was making use of:

  • python 2.7
  • virtualenv, virtualenvwrapper
  • pip

So I have this project structure (basically):

my_project
    |------->my_project (src code)
                      |-------> cli.py
    |-------> setup.py

my setup.py

from setuptools import setup

setup(
    name='my_project',
    version='0.1',
    py_modules=['my_project'],
    install_requires=['Click'],
    entry_points='''
    [console_scripts]
    my_project=my_project.cli:runnable
    '''
)

With this setup if I ran pip install --editable .

it installed my package under dev mode in the site-package directory from my virtualenv, so I was able to run my_project from terminal as a command.

If I follow the same process for pip3 and py3 it works the same way…

Now I’m trying to make use of pipenv so I removed my virtualenv, and create a new one with pipenv --three, so now I have a new virtualenv with py3, then I executed pipenv shell to get into that virtualenv created by pipenv.

To make sure all is good I ran python --version which outputs Python 3.6.2 which is the one declared on my Pipfile. So all good.

So here’s the thing… Following the instructions from pipenv (Editable Dependencies) I executed pipenv install '-e .' --dev

It appends this to my Pipfile

[dev-packages]
"-e ." = "*"

It installed everything and looks like all is good, but at the time of trying to execute my_project from terminal I got some errors:

Traceback (most recent call last):
  File "/Users/atrevino/.virtualenvs/my_project-rf5gIlFJ/bin/my_project", line 11, in <module>
    load_entry_point('my_project==0.1', 'console_scripts', 'my_project')()
  File "/Users/atrevino/.virtualenvs/my_project-rf5gIlFJ/lib/python3.6/site-packages/pkg_resources/__init__.py", line 570, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/atrevino/.virtualenvs/my_project-rf5gIlFJ/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2751, in load_entry_point
    return ep.load()
  File "/Users/atrevino/.virtualenvs/my_project-rf5gIlFJ/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2405, in load
    return self.resolve()
  File "/Users/atrevino/.virtualenvs/my_project-rf5gIlFJ/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2411, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'my_project'

so is there a difference using py3 or py2 with pipenv install '-e .' --dev or maybe am I missing some configuration on my setup.py?

Again, sorry for the long post and have a great day!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kennethreitzcommented, Sep 24, 2017

Make sure you’re using the latest version! We fixed the syntax in the pipfile recently.

0reactions
kennethreitzcommented, Sep 24, 2017

\o/

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the difference between pipenv install <package ...
First way is going to the directory and executing the command pipenv install <package> directly from the directory and in this case, you...
Read more >
Using Python's pip to Manage Your Projects' Dependencies
The pip command looks for the package in PyPI, resolves its dependencies, and installs everything in your current Python environment to ensure ...
Read more >
Command "python setup.py egg_info" failed with error code 1 ...
Virtualenv and pip both work just fine, neither of those two pieces of information are relevant here. Pipenv has a dependency resolver that ......
Read more >
Pipenv: Python Dev Workflow for Humans — pipenv 2022.12 ...
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages.
Read more >
Setting up a Python development environment with pipenv
Pipenv works by creating a virtual environment for isolating the ... One more thing we can do is to run the pip3 freeze...
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