• Register
0 votes
72 views

Problem :

I am usually installing the python packages through the pip.

For my Google App Engine, I need to install the packages to another target directory.

I have already tried below command :

pip install -I flask-restful --target ./lib

But it is failing with below error:

“Must supply either home or prefix/exec-prefix -- not both”

How can I get my App to work?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I believe there is the simpler solution to your problem the Homebrew's Python on macOS that definitely will not break your normal pip operations.

All you need to do is to just create the setup.cfg file at your root directory of the project, usually where the main __init__.py or executable py file is present. So if your root folder of the project is: /path/to/my/project/ then simply create the setup.cfg file in there and put your magic words inside as below :

[install]
prefix=  

Now you will be able to run your pip's commands for that folder as below:

pip install package -t /path/to/my/project/  

The command will run error free for that folder only. Just copy your setup.cfg to the other projects that you might have. And no need to write the .pydistutils.cfg on the home directory.

After you are done with installing your modules, you can safely remove setup.cfg.

9 7 4
38,600 points

Related questions

0 votes
1 answer 1.2K views
1.2K views
Problem : I am very new to Quartz. So whenever I try to install Quartz on my system using pip install Quartz, I face the following error. Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> ... [Errno 2] No such file or directory: 'requirements.txt' I am using Mac OSX with Anaconda. Does anyone have any clue on this issue?
asked Nov 27, 2019 alecxe 7.5k points
0 votes
1 answer 123 views
123 views
Problem : Today I ran into a weird error trying to install Django as follows 'pip3' is not recognized as an internal or external command, operable program or batch file.
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
1 answer 192 views
192 views
Problem: I have recently installed opencv with all the dependencies. After the successful installation I have tried to import matplotlib for the very simple example. I have started facing below error when I only tried to install matplotlib via the pip with pip install ... linux-gnu.so' Consider using the `--user` option or check the permissions. How can I install matplotlib without any error?
asked Aug 26 Raphael Pacheco 4.9k points
2 votes
1 answer 1.4K views
1.4K views
Problem: When I try to run the below command on my command prompt: python get-pip.py It shows the following message: C:\Users\ASUS>python get-pip.py python: can't open file 'get-pip.py': [Errno 2] No such file or directory How can I have pip installed in my system. Then why am I getting this error message and why I can not open this file. Thanks in advance.
asked May 6 samhaz 5k points
0 votes
1 answer 1.7K views
1.7K views
Problem : Following is my issue: I tried to install mysqlclient like below : C:\Users\alecxe>pip install mysqlclient Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1 cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz Installed ... beginner to this and would be very happy if any input as to how to go about fixing above error.
asked Dec 27, 2019 alecxe 7.5k points