2

According to Pipenv doc (https://pipenv.readthedocs.io/en/latest/advanced/#pipenv-and-other-python-distributions), one can "reuse Conda–installed Python packages, use the --site-packages flag":

$ pipenv --python=/path/to/python --site-packages

When using the above command, the Pipfile did not get updated with the packages already installed in the conda environment specified in the --python flag.

1) Is this the expected behaviour of the command?

2) Is there a way to populate the Pipfile automatically?

jackofnone
  • 25
  • 6
  • Though not exactly what you are looking for, you can always run `pip list` inside your Conda environment, or `conda run -n myenv pip list`, or most simply `pipenv run pip list`. – anishpatel Jul 20 '19 at 21:04

1 Answers1

1

As stated in the docs, the --site-packages flag is used for:

reuse Conda–installed Python packages

If you use it, the conda-installed packages will be available for you in the pipenv environment.

You can see that using pip freeze within your pipenv environment.

pipenv run python -m pip freeze

# installed packages will be listed - including conda-installed packages 

If you don't use the --site-packages, you will get an empty environment.

In conclusion:

  1. This will not update your Pipfile, and it is the expected behavior.
  2. There is no automatic way to fill your Pipfile.
Avi Turner
  • 10,234
  • 7
  • 48
  • 75