Errors in installing django module for python - python

I've been trying to install django, looked around the internet but couldn't find possible solution for this.
I have tried looking for solutions. Some solutions told me to install conflict checker for pip but it still did not work because nothing seems to be getting installed using 'pip' keyword. It even gives me error when I try to find out my pip version
python -m pip install django
PS C:\Users\Fahad> python -m pip install django
Traceback (most recent call last):
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\__init__.py", line 19, in
from pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.urllib3
PS C:\Users\Fahad> python -m pip --version
Traceback (most recent call last):
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "C:\Users\Fahad\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.urllib3'

So I tried downloading get-pip.py from here and hen I executed python get-pip.py then I tried re-installing django and it worked.

Related

vitualenv does not work for my 2.7.9 python installation

After installing:
pip install virtualenv
Running it yells:
C:\programs\python\Python27\Scripts>virtualenv.exe
Traceback (most recent call last):
File "C:\programs\python\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\programs\python\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\programs\python\Python27\Scripts\virtualenv.exe\__main__.py", line 5, in <module>
File "C:\programs\python\Python27\lib\site-packages\virtualenv\__init__.py", line 3, in <module>
from .run import cli_run, session_via_cli
File "C:\programs\python\Python27\lib\site-packages\virtualenv\run\__init__.py", line 7, in <module>
from ..app_data import make_app_data
File "C:\programs\python\Python27\lib\site-packages\virtualenv\app_data\__init__.py", line 9, in <module>
from platformdirs import user_data_dir
ImportError: No module named platformdirs
Any ideas why this is happening ?
pip 1.5.6

gevent loading failure: DLL load failed inside venv

I'm currently using venv and gevent inside my python environment, and I can't seem to get it to work. Here's my stack trace:
Traceback (most recent call last):
File "C:\Users\Brian\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Brian\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Projects\sfe-giveaways\venv\lib\site-packages\disco\cli.py", line 12, in <module>
from gevent import monkey
File "D:\Projects\sfe-giveaways\venv\lib\site-packages\gevent\__init__.py", line 48, in <module>
import socket # pylint:disable=unused-import,useless-suppression
File "C:\Users\Brian\AppData\Local\Programs\Python\Python35\lib\socket.py", line 49, in <module>
import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.
I believe that I need a 32-bit version of gevent so it's compatible with venv, but I don't know how to install the 32-bit version. Thanks in advance.

Problems upgrading Ipython (prompt_toolkit incompatibilities)

Trying to open a jupyter notebook file (.ipynb file)
with this command ipython notebook filename.ipynb then I am getting Below Error while using ipython..
Traceback (most recent call last):
File "c:\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python\Scripts\ipython.exe\__main__.py", line 5, in <module>
File "c:\python\lib\site-packages\IPython\__init__.py", line 55, in <module>
from .terminal.embed import embed
File "c:\python\lib\site-packages\IPython\terminal\embed.py", line 16, in
<module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "c:\python\lib\site-packages\IPython\terminal\interactiveshell.py",
line 18, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
ModuleNotFoundError: No module named 'prompt_toolkit'
Just got the same problem.
The solution for me was to pip uninstall prompt-toolkit and pip install prompt-toolkit. This uninstalled v1.0.5 and installed v2.0.4.

cannot use pip in python virtualenv

I created a virtualenv named proj_env and activated in the command prompt of Windows as follows:
C:\Users\me\Desktop\loan_predictor\proj_env\Scripts>activate.bat
(proj_env) C:\Users\me\Desktop\loan_predictor\proj_env\Scripts>pip3 install flask
Traceback (most recent call last):
File "D:\Python\Python35\Lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "D:\Python\Python35\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\me\Desktop\loan_predictor\proj_env\Scripts\pip3.exe\__main__.py", line 5, in <module>
ImportError: No module named 'pip._internal'
I am not sure why both pip and pip3 doesn't work, although it worked when I did pip3 install virtualenv.
What am I missing?

openSSL error in Scrapy while creating project

I have just installed scrapy and all the things along with it as per from scrapy tutorial site.
When I create project using Scrapy with such command
scrapy startproject [projectname]
so it gives me following error
Traceback (most recent call last):
File "c:\python\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python\Python27\Scripts\scrapy.exe\__main__.py", line 9, in <module>
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 122, in execute
cmds = _get_commands_dict(settings, inproject)
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "c:\python\python27\lib\site-packages\scrapy\cmdline.py", line 20, in _iter_command_classes
for module in walk_modules(module_name):
File "c:\python\python27\lib\site-packages\scrapy\utils\misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "c:\python\python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "c:\python\python27\lib\site-packages\scrapy\commands\version.py", line 6, in <module>
import OpenSSL
ImportError: No module named OpenSSL
After that even I tried to install openSSl manually using pip
but it saying that package is already installed
Help me with it.
You can satisfy the missing dependency by doing the following:
You need to install OpenSSL binaries on your system. Get binaries
from here: https://wiki.openssl.org/index.php/Binaries
Then you need to install pyOpenSSL, from here: https://pypi.python.org/pypi/pyOpenSSL/0.13

Categories

Resources