pipenv and eric?

Christian Haul c.haul at web.de
Mon Jul 13 19:05:56 BST 2020


Hi all,
I'm still quite new to python and am just starting to get my head around
virtual environments. I got the impression that pipenv
https://pipenv.pypa.io/en/latest/ is the way to go.

How could I use such an environment it eric?

IIUC pipenv creates regular virtualenv environments.

$ pipenv --python 3.8
Creating a virtualenv for this project…
Using /usr/bin/python3.8 (3.8.4) to create virtualenv…
⠋created virtual environment CPython3.8.4.candidate.1-64 in 170ms
  creator
CPython3Posix(dest=/home/xyz/.local/share/virtualenvs/piptest-UMZySpb3,
clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest,
wheel=latest, pkg_resources=latest, via=copy,
app_data_dir=/home/xyz/.local/share/virtualenv/seed-app-data/v1.0.1.debian)
  activators
BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /home/xyz/.local/share/virtualenvs/piptest-UMZySpb3
$ pipenv shell
Spawning environment shell (/bin/bash). Use 'exit' to leave.
$ . /home/xyz/.local/share/virtualenvs/piptest-UMZySpb3/bin/activate
(piptest-UMZySpb3) $ pipenv --venv
/home/xyz/.local/share/virtualenvs/piptest-UMZySpb3
$ cat /home/xyz/.local/share/virtualenvs/piptest-UMZySpb3/pyvenv.cfg
home = /usr
implementation = CPython
version_info = 3.8.4.candidate.1
virtualenv = 20.0.23+ds
include-system-site-packages = false
base-prefix = /usr
base-exec-prefix = /usr
base-executable = /usr/bin/python3.8

(piptest-UMZySpb3) $ pipenv install ldap3
Installing ldap3…
Looking in indexes: https://pypi.python.org/simple
Collecting ldap3
  Downloading ldap3-2.7-py2.py3-none-any.whl (420 kB)
Collecting pyasn1>=0.1.8
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Installing collected packages: pyasn1, ldap3
Successfully installed ldap3-2.7 pyasn1-0.4.8

Adding ldap3 to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (51db06)!
Installing dependencies from Pipfile.lock (51db06)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:01

On the console, everything is fine, i.e. I can run a program that uses
the ldap3 library.

But, how to configure this in eric?

In Extras->Virtualenv Manager add a new environment
name (does it matter?): pipenv
directory: /home/xyz/projects/python/piptest
python: /usr/bin/python3.8
python variant: python-3
(no checkboxes checked)
prefix:

In window "PyPI" select "piptest", local packages: (empty)

(was expecting ldap3 !?)

In Run->Run Script
Virtual Environment: pipenv
Parameters:
Working Directory: /home/xyz/projects/python/piptest
Environment Variables:

=> unhandled ModuleNotFoundError
„No module named 'ldap3'“

Can someone point me to some documentation / tutorial on how to use
pipenv with eric? Or spot the error above?

TIA
Chris.


More information about the Eric mailing list