Closed WittmannF closed 6 years ago
I used conda until a few weeks ago, but switched to pyenv after I couldn't get pipenv to work with conda for the life of me (due to some fundamental misunderstandings of dependency management on my part).
This StackOverflow answer is probably what you are looking for. Did you install pipenv with pip install pipenv
? Try conda install pipenv
. You should probably run pip uninstall pipenv
first.
conda install pipenv
was my first choice, but when I try, I get the following:
Fetching package metadata ...........
PackageNotFoundError: Packages missing in current channels:
- pipenv
We have searched for the packages in the following channels:
- https://repo.continuum.io/pkgs/main/osx-64
- https://repo.continuum.io/pkgs/main/noarch
- https://repo.continuum.io/pkgs/free/osx-64
- https://repo.continuum.io/pkgs/free/noarch
- https://repo.continuum.io/pkgs/r/osx-64
- https://repo.continuum.io/pkgs/r/noarch
- https://repo.continuum.io/pkgs/pro/osx-64
- https://repo.continuum.io/pkgs/pro/noarch
I got it working now. Here's what I did:
MacBook-Air:~ wittmann$ source activate python3
(python3) MacBook-Air:~ wittmann$ conda install virtualenv
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /Users/wittmann/anaconda/envs/python3:
The following NEW packages will be INSTALLED:
virtualenv: 15.1.0-py34_0
Proceed ([y]/n)? y
virtualenv-15. 100% |################################| Time: 0:00:01 1.04 MB/s
(python3) MacBook-Air:~ wittmann$ conda install pip
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /Users/wittmann/anaconda/envs/python3:
The following packages will be UPDATED:
pip: 8.1.2-py34_0 --> 9.0.1-py34_1
Proceed ([y]/n)? y
pip-9.0.1-py34 100% |################################| Time: 0:00:03 512.06 kB/s
(python3) MacBook-Air:~ wittmann$ ls
Applications Public nilmtk
Desktop Untitled.ipynb nltk_data
Documents Untitled1.ipynb projects
Downloads ampl scikit_learn_data
Google Drive anaconda seaborn-data
Library download_unzip.py.save spyder_crash.log
Movies gcloud test.pem
Music gcloud.pub urplus
NILM Paper nano.save
Pictures nilm_metadata
(python3) MacBook-Air:~ wittmann$ cd urplus/
(python3) MacBook-Air:urplus wittmann$ ls
LICENSE Pipfile.lock README.md extension
Pipfile Procfile backend frontend
(python3) MacBook-Air:urplus wittmann$ virtualenv install
Using base prefix '/Users/wittmann/anaconda/envs/python3'
New python executable in /Users/wittmann/urplus/install/bin/python
copying /Users/wittmann/anaconda/envs/python3/bin/python => /Users/wittmann/urplus/install/bin/python
copying /Users/wittmann/anaconda/envs/python3/bin/../lib/libpython3.4m.dylib => /Users/wittmann/urplus/install/lib/libpython3.4m.dylib
Installing setuptools, pip, wheel...done.
(python3) MacBook-Air:urplus wittmann$ pip install pipenv
Requirement already satisfied: pipenv in /Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages
Requirement already satisfied: virtualenv in /Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages (from pipenv)
Requirement already satisfied: pew>=0.1.26 in /Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages (from pipenv)
Requirement already satisfied: pip>=9.0.1 in /Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages (from pipenv)
Requirement already satisfied: setuptools>=17.1 in /Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg (from pew>=0.1.26->pipenv)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages (from pew>=0.1.26->pipenv)
(python3) MacBook-Air:urplus wittmann$ pipenv install
Creating a virtualenv for this project…
⠋Using base prefix '/Users/wittmann/anaconda/envs/python3'
New python executable in /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/bin/python
copying /Users/wittmann/anaconda/envs/python3/bin/python => /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/bin/python
copying /Users/wittmann/anaconda/envs/python3/bin/../lib/libpython3.4m.dylib => /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/lib/libpython3.4m.dylib
Installing setuptools, pip, wheel...done.
Virtualenv location: /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu
Installing dependencies from Pipfile.lock (131cf6)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 13/13 — 00:00:33
To activate this project's virtualenv, run the following:
$ pipenv shell
(python3) MacBook-Air:urplus wittmann$ cd backend
(python3) MacBook-Air:backend wittmann$ ls
manage.py remarks urplus
(python3) MacBook-Air:backend wittmann$ pipenv run python manage.py migrate
Loading .env environment variables…
/Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/lib/python3.4/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
Operations to perform:
Apply all migrations: admin, auth, contenttypes, remarks, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying remarks.0001_initial... OK
Applying sessions.0001_initial... OK
I think some steps were unnecessary such as installing conda install virtualenv
and virtualenv install
. I think that what helped was to update pip
in the environment. However, now I am having a new problem when running the backend. I will close this issue and open a new one since both problems seem to be unrelated.
My native Python is 2.7, however I am using a conda environment with Python 3 for installing it. At first, I was having an error related to locale
the environment variable LANG is not set! We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
. I fixed that by adding the linesexport LC_ALL=en_US.UTF-8
andexport LANG=en_US.UTF-8
to the file~\.profile
. Now, I am getting a new errorERROR: virtualenv is not compatible with this system or executable
. Any hint on how to solve that? Here's the full error log: