I am trying to install readthedocs in local system (Ubuntu 14.04 ) in python3 virtual env from the instructions given in this link
When I ran pip3 install -r requirements.txt , I got an error for Distutils2 . I removed that dependency as the distutils2 is no longer supported and assumed setuptools would suffice.
Running this command python manage.py migrate gave the below error :
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/contrib/admin/apps.py", line 22, in ready
self.module.autodiscover()
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/contrib/admin/__init__.py", line 24, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/utils/module_loading.py", line 74, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/home/username/read_the_docs_env/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/home/username/Desktop/CurrentProjects/read_the_docs/checkouts/readthedocs.org/readthedocs/core/admin.py", line 10, in <module>
from readthedocs.core.views import SendEmailView
File "/home/username/Desktop/CurrentProjects/read_the_docs/checkouts/readthedocs.org/readthedocs/core/views/__init__.py", line 26, in <module>
from readthedocs.projects.tasks import remove_dir
File "/home/username/Desktop/CurrentProjects/read_the_docs/checkouts/readthedocs.org/readthedocs/projects/tasks.py", line 493
print "Sync Versions Exception: %s" % e.message
^
SyntaxError: Missing parentheses in call to 'print'
I understand from the above stacktrace that the code is in python2 and so print statement is different in python3 .
Does this mean that I have to install readthedocs in python2 virtualenv ?
Can't we host the docs of python3 projects in readthedocs in-house server ?
The read the docs code does not support Python 3 yet. The installation instructions explicitly say to use Python 2.7:
First, obtain Python 2.7 and virtualenv
However, it should still be possible to use your read the docs installation to host docs for Python 3 projects, since the instructions then say:
If you plan to import Python 3 project to your RTD then you’ll need to install Python 3 with virtualenv in your system as well.
Related
I uses PyCharm's terminal for the action below.
I was unable to install packages using pip. If I tried to install, it raises a error.
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\~\PycharmProjects\pythonProject\venv\Scripts\pip.exe\__main__.py", line 7, in <module>
File "C:\Users\~\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\main.py", line 68, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "C:\Users\~\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\commands\__init__.py", line 114, in create_command
module = importlib.import_module(module_path)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\~\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\commands\install.py", line 13, in <module>
from pip._internal.cache import WheelCache
ModuleNotFoundError: No module named 'pip._internal.cache'
Looking at the error, I found it's related to "caches", And I wrote a program which deletes all files which contains "cache" in it's name a few days ago since my computer is full of cache before.
My question is: Is it possible to add back the pip cache file back?
Looking forward to replys and answers.
Edit: Errors returned by using "pip install":
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\terence\PycharmProjects\pythonProject\venv\lib\site-packages\pip\__main__.py", line 31, in <module>
sys.exit(_main())
File "C:\Users\terence\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\main.py", line 68, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "C:\Users\terence\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\commands\__init__.py", line 114, in create_command
module = importlib.import_module(module_path)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\terence\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\commands\uninstall.py", line 9, in <module>
from pip._internal.cli.req_command import SessionCommandMixin, warn_if_run_as_root
File "C:\Users\terence\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\req_command.py", line 15, in <module>
from pip._internal.cache import WheelCache
ModuleNotFoundError: No module named 'pip._internal.cache'
The error message "ModuleNotFoundError: No module named 'pip._internal.cache'" typically indicates that there is an issue with the version of pip that you have installed on your system. This error message occurs when the module 'pip._internal.cache' is not found in the version of pip that you are using.
To fix this error, you can try upgrading pip to the latest version by running the command:
pip install --upgrade pip
If the issue persists, you can try uninstalling and reinstalling pip using the command:
python -m pip uninstall pip
And then
python -m pip install pip
Alternatively, you can try installing the package using the following command:
python -m pip install package_name
It's also possible that you have multiple versions of python installed on your system, and the one you're using doesn't have pip package. In this case, you can try running the above command with the python version that has pip installed.
It's also a good practice to use virtual environments to keep the dependencies and packages isolated.
Please let me know if there's anything else I can help with.
As you python environment is broken, I'd recommend you to reinstall pip.
If that doesn't work, just reinstall python.
Also, better don't delete all files with a specific name-pattern.
You (as you see) just break programms with it.
Better delete all files in you temp folder (%temp% in windows)
I have this new remote job, where I had to clone all the code from a repository, and I have to make an export of the database from MySQL hosted in RDS.
The first problem is that when I set up the configuration to start the app, it raise an error telling me this:
Run Configuration Error: Broken configuration due to unavailable plugin or invalid configuration data.
The other thing is that I already have the data dumped and set up in my local storage (the app works this way, is no longer using AWS Cloud) but when I try to do an python manage.py migrate , this error comes up...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Tony-App\Documents\App\venv\lib\site-packages\django\core\management\__init__.py", line 338, in execute_from_command_line
utility.execute()
File "C:\Users\Tony-App\Documents\App\venv\lib\site-packages\django\core\management\__init__.py", line 312, in execute
django.setup()
File "C:\Users\Tony-App\Documents\App\venv\lib\site-packages\django\__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Tony-App\Documents\App\venv\lib\site-packages\django\apps\registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Tony-App\Documents\App\venv\lib\site-packages\django\apps\config.py", line 86, in create
module = import_module(entry)
File "C:\Users\Tony-App\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Tony-App\Documents\App\venv\lib\site-packages\liststyle\__init__.py", line 1, in <module>
from admin import ListStyleAdminMixin
ModuleNotFoundError: No module named 'admin'
First, django-liststyle is a dependency in your project, so make sure it has been installed.
py -m pip install django-liststyle
Second, make sure to add that package to INSTALLED_APPS:
INSTALLED_APPS = {
...
'liststyle',
...
'django.contrib.admin',
...
}
Third, I think the error you are getting is because of the way you are importing ListStyleAdminMixin. This should be the correct way to import it:
from liststyle.admin import ListStyleAdminMixin
I am getting the following error when trying to launch shell_plus after installing django_extensions. Here are the steps i followed
1-Installed django_extensions using
pip install django_extensions
2-Added django_extensions to installed apps
Then I get the following error
$ ./manage.py shell_plus
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/Users/admin/Development/project/virtual/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/Users/admin/Development/project/virtual/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/admin/Development/project/virtual/lib/python3.5/site-packages/django/core/management/__init__.py", line 216, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/admin/Development/project/virtual/lib/python3.5/site-packages/django/core/management/__init__.py", line 36, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/Users/admin/Development/project/virtual/lib/python3.5/site-packages/django_extensions/management/commands/shell_plus.py", line 14, in <module>
from django_extensions.management.shells import import_objects
File "/Users/admin/Development/project/virtual/lib/python3.5/site-packages/django_extensions/management/shells.py", line 5, in <module>
from typing import ( # NOQA
ImportError: cannot import name 'Type'
Any suggestions on what might be going wrong ?
Python 3.5 comes with its own version of typing module. What is most likely happening is that you have the other typing module specified in your requirements (the one that doesn't include Type class) and its getting picked up by django_extensions instead of the native Python one. Check your installed modules, or try running:
pip uninstall typing
I want use search library in django
So i decide to use django-watson(it tell me easy install, easy use)
I command
git clone https://github.com/etianen/django-watson.git
in my django projects
and insert watson in my settings.py. INSTALLED_APPS
when I command
python manage.py migrate
django can't find watson so I decide uninstall django-watson and reinstall
I command
rm -rf django-watson
and command migrate (check about when i was uninstall library migrate has no problem)
python manage.py migrate
suddenly it show me error for me
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/Users/hanminsoo/.pyenv/versions/3.5.1/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'django-watson'
I think it has installed in env but i can't find where is django-watson
I want remove django-watson clearly
please somebody help me
Make sure you have removed it from INSTALLED_APPS in settings.py and that you have removed all imports related to it inside your project.
As said, you have to remove django-watson from your installed apps. But that was the original mistake: to install watson, you have to add watson to your INSTALLED_APPS, not django-watson. This is well explained in the documentation:
Install django-watson using pip: pip install django-watson.
Add 'watson' to your INSTALLED_APPS setting.
Question title says it all. I'm not a Python expert, not sure where to go from here. I tried everything I could think of.
I'm using pip3 and python3 with Django 1.8.
Following instructions from https://github.com/omab/python-social-auth I did sudo pip3 install python-social-auth and all the dependencies.
Shell output:
$ python3 manage.py shell
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/usr/local/lib/python3.4/dist-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.4/dist-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/usr/local/lib/python3.4/dist-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/usr/local/lib/python3.4/dist-packages/social/apps/django_app/default/models.py", line 8, in <module>
from social.utils import setting_name
File "/usr/local/lib/python3.4/dist-packages/social/utils.py", line 13, in <module>
from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named 'requests.packages'
I'm not sure why the python-social-auth module tries to call requests.packages since that does not seem to exist in the "requests" module.
I solved my own problem.
sudo pip3 install requests --upgrade
Fixed it by upgrading my system's "requests" package.
this question may be getting a bunch of new visitors...
requests.packages has been removed from requests:
https://github.com/kennethreitz/requests/pull/4067
install the vendored libraries separately
pip install urllib3