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 3, 2020 in Python by kartik
• 37,510 points
5,899 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 3, 2020 by Niroj
• 82,880 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,210 points
2,337 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
6,931 views
0 votes
1 answer
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, 2020 in Python by Niroj
• 82,880 points
2,030 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, 2020 in Python by Niroj
• 82,880 points
1,176 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, 2020 in Python by Niroj
• 82,880 points
2,443 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, 2020 in Python by Niroj
• 82,880 points
2,939 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP