• Register
0 votes
143 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

Please log in or register to answer this question.

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 13 views
13 views
PROBLEM : Someone help me to fix this Please on > 'pip install could not find a version that satisfies the requirement' ?
asked Mar 16 Samiur1 38.4k points
0 votes
1 answer 2K views
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 332 views
332 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
1 vote
1 answer 2 views
2 views
Problem: Can I get some help with this? This apple id has not yet been used with the app store.
asked Mar 29 PkGuy 13.1k points
0 votes
0 answers 4 views
4 views
Problem: Need a feasible solotiion for this excel solver. Solver could not find a feasible solution.
asked Mar 25 PkGuy 13.1k points
0 votes
0 answers 38 views
38 views
Have been trying to install the latest version of "opencv-contrib-python" package in the new Raspberry Pi (RPi 4). At the time of this writing, the latest version is 4.2.0.34. When I do not specify the version with command pip install opencv-contrib- ... and installing wheel. I have tried these long before. I really appreciate it if anyone can comment who might have come across this problem.
asked Oct 27, 2020 psandprop 2.4k points
1 vote
1 answer 7 views
7 views
Problem: I am facing this fatalerror. Do not know why? Fatal error: adafruit_sensor.h: no such file or directory.
asked Mar 24 PkGuy 13.1k points
0 votes
1 answer 15 views
15 views
Problem; HELP! I need help understanding this error and why it still happened to me : Fatal error c1083: cannot open include file: 'mysql.h': no such file or directory.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 43 views
43 views
Problem: any help : Python: can't open file 'get-pip.py': [errno 2] no such file or directory.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 2.5K views
2.5K 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, 2020 Raphael Pacheco 4.9k points