Reputation: 385
I am using Django 1.11.
I'm using in my Django application the django-bleach that was installed with:
pip install django-bleach
Here the lib folder when django-bleach is installed this way:
drwxr-xr-x 3 breno breno 4,0K jan 7 18:30 bleach
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 bleach-2.1.2.dist-info
drwxr-xr-x 19 breno breno 4,0K jan 7 18:30 django
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 Django-2.0.1.dist-info
drwxr-xr-x 4 breno breno 4,0K jan 7 18:30 django_bleach
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 django_bleach-0.3.0.egg-info
-rw-r--r-- 1 breno breno 126 jan 7 18:18 easy_install.py
drwxr-xr-x 8 breno breno 4,0K jan 7 18:30 html5lib
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 html5lib-1.0.1.dist-info
drwxr-xr-x 11 breno breno 4,0K jan 7 18:18 pip
drwxr-xr-x 2 breno breno 4,0K jan 7 18:18 pip-9.0.1.dist-info
drwxr-xr-x 5 breno breno 4,0K jan 7 18:18 pkg_resources
drwxr-xr-x 2 breno breno 4,0K jan 7 18:18 pkg_resources-0.0.0.dist-info
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 __pycache__
drwxr-xr-x 4 breno breno 4,0K jan 7 18:30 pytz
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 pytz-2017.3.dist-info
drwxr-xr-x 5 breno breno 4,0K jan 7 18:18 setuptools
drwxr-xr-x 2 breno breno 4,0K jan 7 18:18 setuptools-32.3.1.dist-info
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 six-1.11.0.dist-info
-rw-r--r-- 1 breno breno 31K jan 7 18:30 six.py
drwxr-xr-x 3 breno breno 4,0K jan 7 18:30 webencodings
drwxr-xr-x 2 breno breno 4,0K jan 7 18:30 webencodings-0.5.1.dist-info
So, when I would use it, I've gotten an import error that I fixed, the error occurs in Django version 1.6 or 1.8+, I guess. You can see here what I did. It worked and I continue the development.
The problem is: now I am trying to deploy my application in Heroku, but the same error occurs and the import has to be fixed.
So, I think that my repository should have the requirements.txt with the correct version of django-bleach (the one that have my commit), this way it would works properly, right?
So, I forked the repository, commited the modification and created a requirements.txt with this text:
-e git+https://[email protected]/breno_asrm/django-bleach.git#egg=django-bleach
Then I created a new virtual env and installed with
pip install -r requirements.txt
Here is the result of the lib folder of this environment
drwxr-xr-x 3 breno breno 4,0K jan 7 18:15 bleach
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 bleach-2.1.2.dist-info
drwxr-xr-x 19 breno breno 4,0K jan 7 18:15 django
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 Django-2.0.1.dist-info
-rw-r--r-- 1 breno breno 51 jan 7 18:15 django-bleach.egg-link
-rw-r--r-- 1 breno breno 50 jan 7 18:15 easy-install.pth
-rw-r--r-- 1 breno breno 126 jan 7 18:14 easy_install.py
drwxr-xr-x 8 breno breno 4,0K jan 7 18:15 html5lib
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 html5lib-1.0.1.dist-info
drwxr-xr-x 11 breno breno 4,0K jan 7 18:14 pip
drwxr-xr-x 2 breno breno 4,0K jan 7 18:14 pip-9.0.1.dist-info
drwxr-xr-x 5 breno breno 4,0K jan 7 18:14 pkg_resources
drwxr-xr-x 2 breno breno 4,0K jan 7 18:14 pkg_resources-0.0.0.dist-info
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 __pycache__
drwxr-xr-x 4 breno breno 4,0K jan 7 18:15 pytz
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 pytz-2017.3.dist-info
drwxr-xr-x 5 breno breno 4,0K jan 7 18:14 setuptools
drwxr-xr-x 2 breno breno 4,0K jan 7 18:14 setuptools-32.3.1.dist-info
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 six-1.11.0.dist-info
-rw-r--r-- 1 breno breno 31K jan 7 18:15 six.py
drwxr-xr-x 3 breno breno 4,0K jan 7 18:15 webencodings
drwxr-xr-x 2 breno breno 4,0K jan 7 18:15 webencodings-0.5.1.dist-info
I thought it would install the same thing as before, just adding my modification, but it was not what happened.
For instance, now my lib directory (env/lib/python3.5/site-packages/ ) doesn't have django_bleach folder.
So, how could I fix it in a way that I don't have to modify the heroku virtualenv that is created automatically (if it's possible)?
Upvotes: 1
Views: 88
Reputation: 3959
Looks like pip is unable to authenticate with your user breno_asrm
. As the repository is public - just remove your username in front.
-e git+https://bitbucket.org/breno_asrm/django-bleach.git#egg=django-bleach
Where do the files go?
Dependencies installed by pip using -e
from a repository are located in another folder of your environment.
From the man page of pip:
-e,--editable
Install a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.
Have a look in venv_root/src
- you'll see django-bleach there (which in your case is a clone of your git repository). venv_root/lib/python3.x/sites-packages/django-bleach.egg-link
includes the information where the sources can be found. Check it using less
or cat
. In my case it looks like this:
/tmp/env/src/django-bleach
.%
The environment will work as expected.
Together with the following option of pip all this makes more sense. This way you can easily work on an library while it is installed but not necessarily located in your environment.
--src < dir >
Directory to check out editable projects into. The default in a virtualenv is "< venvpath >/src". The default for global installs is "< current dir >/src".
Upvotes: 1