dylantientcheu / urplus

A collection of tools to enhance the Udacity reviewer experience, including integrated remark storage and retrieval
GNU General Public License v3.0
8 stars 5 forks source link

Compatibility issue with MacOS Sierra #16

Closed WittmannF closed 6 years ago

WittmannF commented 6 years ago

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 lines export LC_ALL=en_US.UTF-8 and export LANG=en_US.UTF-8 to the file ~\.profile. Now, I am getting a new error ERROR: virtualenv is not compatible with this system or executable. Any hint on how to solve that? Here's the full error log:

(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
dyld: Library not loaded: @rpath/libpython3.4m.dylib
  Referenced from: /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/bin/python
  Reason: image not found
ERROR: The executable /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/wittmann/urplus' (should be '/Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu')
ERROR: virtualenv is not compatible with this system or executable

Virtualenv location: 
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
dyld: Library not loaded: @rpath/libpython3.4m.dylib
  Referenced from: /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/bin/python
  Reason: image not found
ERROR: The executable /Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/wittmann/urplus' (should be '/Users/wittmann/.local/share/virtualenvs/urplus-v-12Gtbu')
ERROR: virtualenv is not compatible with this system or executable

Virtualenv location: 
Installing dependencies from Pipfile.lock (131cf6)…
Traceback (most recent call last):▉▉▉▉ 0/13 — 00:00:00
  File "/Users/wittmann/anaconda/envs/python3/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/cli.py", line 197, in install
    selective_upgrade=selective_upgrade
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/core.py", line 1821, in do_install
    do_init(dev=dev, allow_global=system, ignore_pipfile=ignore_pipfile, system=system, skip_lock=skip_lock, verbose=verbose, concurrent=concurrent, deploy=deploy, pre=pre)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/core.py", line 1366, in do_init
    skip_lock=skip_lock, verbose=verbose, concurrent=concurrent)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/core.py", line 856, in do_install_dependencies
    index=index
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/core.py", line 1466, in pip_install
    c = delegator.run(pip_command, block=block)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/delegator.py", line 267, in run
    c.run(block=block, binary=binary)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/delegator.py", line 156, in run
    s = PopenSpawn(self._popen_args, **pexpect_kwargs)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/site-packages/pipenv/vendor/pexpect/popen_spawn.py", line 46, in __init__
    self.proc = subprocess.Popen(cmd, **kwargs)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/subprocess.py", line 856, in __init__
    restore_signals, start_new_session)
  File "/Users/wittmann/anaconda/envs/python3/lib/python3.4/subprocess.py", line 1460, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/bin/pip'
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/13 — 00:00:00
michaelhays commented 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.

WittmannF commented 6 years ago

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
WittmannF commented 6 years ago

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.