Comments (6)
Hi Eraldo,
Thanks for trying. You're actually the first person who has tried it on El Capitan and reported back. I was worried there might be problems on that environment :/
The problem looks like it might be related to this: https://stackoverflow.com/questions/16460313/pip-could-not-find-an-activated-virtualenv-required
Do you have the environment variable PIP_REQUIRE_VIRTUALENV=true ?
If it is, could you try setting it to false, doing pip install --upgrade hitch (with the system python) and then do:
hitch cleanpkg
hitch clean
hitch test .
P.S. Hitch sets up virtualenvs for you - it creates one for the testing environment and creates another one for your code. There's no need to use virtualenvwrapper or virtualenv yourself.
from hitch.
Yes, PIP_REQUIRE_VIRTUALENV
is set to true
for my system python.
I do syspip install
if I want to force an install into my system python.
In general I want to stay away from installing packages into my osx system python (2.7), thus keeping it clean and preferring to use the pyenv python versions and or virtual environments.
Running syspip install --upgrade hitch
gives me:
Requirement already up-to-date: hitch in /usr/local/var/lib/pyenv/versions/3.4.1/lib/python3.4/site-packages
Cleaning up...
Using..
eraldo@EroBookPro:~$ pyenv version
3.4.1 (set by /usr/local/opt/pyenv/version)
Is there a way to make hitch use pyenv or the virtualenv version instead?
Or .. unset the variable locally within it's installed python?
=> So that I still do not accidentally install requirement files into the system python. (the reason for setting the variable to true
)
Thank's for the fast reply @crdoconnor .. I appreciate it since I did not find other people talking about it. :D
from hitch.
Yes, PIP_REQUIRE_VIRTUALENV is set to true for my system python.
Ok, that's probably it.
In general I want to stay away from installing packages into my osx system python (2.7), thus keeping it clean and preferring to use the pyenv python versions and or virtual environments.
Understood, and 99% of the time that's the right approach. The hitch bootstrap script, however, is tiny, clean, tested on all versions of python and doesn't have any dependencies.
All it really does is set up a python 3 virtualenv and run stuff in that virtualenv.
Is there a way to make hitch use pyenv or the virtualenv version instead?
That hitch python 3 virtualenv I talked about bundles pyenv. It downloads whichever version of python you specify in your test and installs it into ~/.hitchpkg. From that it creates a virtualenv to run your application code in in the .hitch directory.
That's what these two lines do in engine.py::
python_package = hitchpython.PythonPackage(version=2.7.6)
python_package.build()
Then:
python_package.python = "/path/to/your/new/project/virtualenv/python"
It's all a bit indirect and complicated but doing it this way largely means that your system python is isolated from your test python which is in turn isolated from the python used to run your code. Keeping them apart cuts down on quirky unexpected behavior in all environments.
Or .. unset the variable locally within it's installed python?
You can unset the variable just for one command like so::
PIP_REQUIRE_VIRTUALENV=false hitch init
PIP_REQUIRE_VIRTUALENV=false hitch test .
Thank's for the fast reply @crdoconnor .. I appreciate it since I did not find other people talking about it. :D
No worries. Thank you very much for reporting the issue. I wouldn't have picked up on it otherwise. Please, next time if you're confused, don't spend hours debugging. I'm pretty keen to fix stuff that's just confusing as well as outright bugs like this.
from hitch.
Update: (workaround)
I added export PIP_REQUIRE_VIRTUALENV=false
to the postactivation hook of my virtual environment for that project.
This way.. hitch works and my system stays clean when not working on that project.
Changing the variable within the project is okay for me since the project's virtual environment uses another pyenv than the system one. So in the worst case I am cluttering a custom installed python version and not the true system version.
from hitch.
Did everything work after you did that?
from hitch.
Yes, this workaround works.
from hitch.
Related Issues (20)
- clicking invisible elements -- try catch block ignored -- ElementNotVisibleException HOT 7
- Python SSL extension not compiled HOT 3
- Multiple errors initialising on Mac OS (10.11.2) HOT 8
- celery problem? HOT 10
- Issue django shell commands // create/update models HOT 2
- Running Test Stub; Error About Missing Requirements.txt HOT 5
- file upload error (on fill_form) HOT 8
- Selenium - test that something does NOT appear HOT 4
- Running in Debian Docker Container HOT 4
- Error on El Capitan HOT 10
- Error starting firefox for selenium on Ubuntu 14.04 HOT 5
- Error running hitch install to upgrade hitchselenium HOT 9
- HTML IDs modified HOT 1
- hitchNode missing in docs
- Stub error HOT 6
- error in installing pyuv HOT 1
- Cannot run example project on Windows PC
- Package installation of libzmq failed.
- `hitch init` failure: module 'pip' has no attribute 'get_installed_distributions'
- Dead documentation on ReadTheDocs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hitch.