Comments (12)
As a sidenote, got the same result with pip install drfdocs==0.0.10
, but successfully installed 0.0.09 with pip install drfdocs==0.0.09
from django-rest-framework-docs.
The reason this is happening for some people and not others, as far as I can tell, is that a fair number of people have $PYTHONPATH=.
set somewhere in their environments. I had this, and it didn't work - when I removed it, it worked. If you don't have it, the site
directory doesn't get used instead of the built in library. I think there's something on my system that sets this for me, because it was being set even when I removed it from my zshrc - perhaps a part of virtualenvwrapper?
As a quick fix, this should work:
unset PYTHONPATH
pip install drfdocs
from django-rest-framework-docs.
I also experienced this on Python 3.5 on Ubuntu 16.04.
Seems like the error is caused by a site
package inside the latest dist on pypi. This clashes with a stdlib module (https://docs.python.org/3/library/site.html) and breaks the import path.
from django-rest-framework-docs.
That's weird - I've just tried on a fresh virtual environment (both 3.5 & 2.7) and it works fine for me.
Update: Just tried on a fresh Ubuntu install (Python 2.7) and it worked there too.
from django-rest-framework-docs.
Here is my output on a clean virtualenv:
rohan@uberbook:$ mkvirtualenv drfdocs$ pip freeze
Using base prefix '/home/rohan/.pyenv/versions/3.5.1'
New python executable in /home/rohan/venv/drfdocs/bin/python3.5
Also creating executable in /home/rohan/venv/drfdocs/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/rohan/venv/drfdocs/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/rohan/venv/drfdocs/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/rohan/venv/drfdocs/bin/preactivate
virtualenvwrapper.user_scripts creating /home/rohan/venv/drfdocs/bin/postactivate
virtualenvwrapper.user_scripts creating /home/rohan/venv/drfdocs/bin/get_env_details
(drfdocs) rohan@uberbook:
(drfdocs) rohan@uberbook:$ pip list$ pip install drfdocs
pip (8.1.2)
setuptools (25.1.0)
wheel (0.29.0)
(drfdocs) rohan@uberbook:
Collecting drfdocs
Using cached drfdocs-0.0.11.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-moeu5f0y/drfdocs/
UPDATE:
It installs fine when I remove the site
package/directory mentioned above after I manually extracted the dist (tar.gz file) and run python setup.py install
. It also works fine if I clone from github and build my own dist.
from django-rest-framework-docs.
same error for me
from django-rest-framework-docs.
Same issue here.
from django-rest-framework-docs.
Same issue here. drfdocs==0.0.9 works, no luck with 0.0.10 or 0.0.11.
Already reinstalled everything and still have the issue.
☁ ph [master] ⚡ pip uninstall drfdocs -y > /dev/null; pip install drfdocs==0.0.9 --no-cache-dir
Collecting drfdocs==0.0.9
Downloading drfdocs-0.0.9.tar.gz (770kB)
100% |████████████████████████████████| 778kB 5.0MB/s
Installing collected packages: drfdocs
Running setup.py install for drfdocs ... done
Successfully installed drfdocs-0.0.9
☁ ph [master] ⚡ pip uninstall drfdocs -y > /dev/null; pip install drfdocs==0.0.10 --no-cache-dir
Collecting drfdocs==0.0.10
Downloading drfdocs-0.0.10.tar.gz (770kB)
100% |████████████████████████████████| 778kB 5.0MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named setuptools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l8/gl87lhfn54b62j4j31x62j0r0000gn/T/pip-build-asTlbg/drfdocs/
☁ ph [master] ⚡ pip uninstall drfdocs -y > /dev/null; pip install drfdocs==0.0.11 --no-cache-dir
Cannot uninstall requirement drfdocs, not installed
Collecting drfdocs==0.0.11
Downloading drfdocs-0.0.11.tar.gz (771kB)
100% |████████████████████████████████| 778kB 6.7MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named setuptools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l8/gl87lhfn54b62j4j31x62j0r0000gn/T/pip-build-SF7wDg/drfdocs/
☁ ph [master] ⚡
More info:
Running setup.py (path:/private/var/folders/l8/gl87lhfn54b62j4j31x62j0r0000gn/T/pip-build-WMU0qV/drfdocs/setup.py) egg_info for package drfdocs
Running command python setup.py egg_info
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named setuptools
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l8/gl87lhfn54b62j4j31x62j0r0000gn/T/pip-build-WMU0qV/drfdocs/
Exception information:
Traceback (most recent call last):
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/Users/caio/.pyenv/versions/2.7.12/envs/ph/lib/python2.7/site-packages/pip/utils/__init__.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l8/gl87lhfn54b62j4j31x62j0r0000gn/T/pip-build-WMU0qV/drfdocs/
from django-rest-framework-docs.
+1 for this issue. Have the same error on Docker Alpine Python 2.7
from django-rest-framework-docs.
I run into the same issue as well. This seems to depend on the Python environment being used.
On vanilla Ubuntu 16.04, I created a virtual environment using python3.5 -m venv env-dir
and I was able to install drfdocs
.
However, in a different Python environment setup using miniconda, I ran into the above mentioned error.
pip install drfdocs==0.0.11
Collecting drfdocs==0.0.11
Using cached drfdocs-0.0.11.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-odatsxp2/drfdocs/
from django-rest-framework-docs.
same issue for me. cannot install versions after 0.0.9
from django-rest-framework-docs.
same error
using Ubuntu14.04 with anaconda venv
python version: Python 3.6.3 :: Anaconda, Inc.
pip version: pip 9.0.1 from /home/bllli/venv/ikm/lib/python3.6/site-packages (python 3.6)
Collecting drfdocs
Using cached drfdocs-0.0.11.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ej4br7ae/drfdocs/
but I can import setuptools with python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools
<module 'setuptools' from '/home/bllli/venv/ikm/lib/python3.6/site-packages/setuptools/__init__.py'>
>>>
from django-rest-framework-docs.
Related Issues (20)
- Muliple line doc strings appearing as one HOT 6
- Show field of nested serializers in Live API Endpoints HOT 3
- Decorator to show fields for api views
- Can't figure out how to enter data in ListField and DictField.
- It is possible to listing param in comment section of API?
- Does it support function based views?
- DRF docs not taking the data fields HOT 1
- get_serializer_class doesn't recreate same conditions as would be used by DRF HOT 1
- Its not working with viewset HOT 2
- doesn't support read_only_fields in serializer
- DRFDocs not showing delete, post, etc. options but regular docs do? HOT 7
- Hide OPTIONS method?
- Django 2.0 Support HOT 16
- Override template
- Error in import HOT 5
- RegexURLPattern and RegexURLResolver must be changed to URLPattern and URLResolver respectively
- api_endpoint __get_permissions_class__ missing __name__
- ModuleNotFoundError: No module named 'django.core.urlresolvers' error HOT 4
- Need to add token field in header
- from django.conf.urls import url
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 django-rest-framework-docs.