Error:Pip install: can't open file pip, or Parent module '' not loaded

0 votes

I'm trying to install Django. So here's what I do in the command line:

C:\>python34 pip install Django

And here's what I get:

C:\Python34\python.exe: can't open file 'pip': [Errno 2] No such file or directory

If I do the same from the site-packages directory:

C:\Python34\Lib\site-packages>python34 pip install Django
Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "pip\__main__.py", line 2, in <module>
    from .runner import run
SystemError: Parent module '' not loaded, cannot perform relative import

I used pip before, and it worked fine, but now I don't know how to run it properly.Could anyone explain what I need to do to get this right?

Jul 2 in Python by kartik
• 19,650 points
108 views

1 answer to this question.

0 votes

Hello @kartik,

Assuming you have pip installed and you want to do this through python as opposed to the standalone pip client, you can also do

python -m pip install SomePackage

Hope it works!!
Thanks!!

answered Jul 2 by Niroj
• 41,480 points

Related Questions In Python

0 votes
1 answer

How to print a message or the error if a file is not found?

To print the message that file is not ...READ MORE

answered Jan 2, 2019 in Python by Omkar
• 69,040 points
119 views
0 votes
1 answer

Open a file if it exists or create and open it does not exists - Python

You can use this: f = open("ex.txt","w+") Here the ...READ MORE

answered Jun 20, 2019 in Python by Jason
1,737 views
0 votes
1 answer

How to temporarily disable a foreign key constraint in MySQL?

Hello @kartik, To turn off foreign key constraint ...READ MORE

answered Jun 23 in Python by Niroj
• 41,480 points
58 views
0 votes
1 answer

How do I use Django templates without the rest of Django?

Hello @kartik, Let's say you have this important ...READ MORE

answered Jun 23 in Python by Niroj
• 41,480 points
40 views
0 votes
1 answer

Error:pip install mysql-python fails with EnvironmentError: mysql_config not found

Hello @kartik, It seems mysql_config is missing on ...READ MORE

answered May 5 in Python by Niroj
• 41,480 points
168 views
0 votes
1 answer

Error:pip install mysql-python fails with EnvironmentError: mysql_config not found

Hello @kartik, For centos users: yum install -y mysql-devel python-devel python-setuptools then pip ...READ MORE

answered May 27 in Python by Niroj
• 41,480 points
198 views