• Register
0 votes
102 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 1.6K views
1.6K 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 229 views
229 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
0 answers 15 views
15 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
0 votes
1 answer 1.2K views
1.2K 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
2 votes
1 answer 2.6K views
2.6K 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, 2020 samhaz 5k points
0 votes
1 answer 2.5K views
2.5K 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
0 votes
1 answer 23 views
23 views
I am struggling with Jetson TX2 board (aarch64). I need to install python wrapper for OpenCV. I can do: $ sudo apt-get install python-opencv But I cannot do: $ sudo pip install opencv-python Is this because there is no proper wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv ? Is there a way to install opencv-python through pip?
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 132 views
132 views
Problem : I want to intstall the TensorFlow using pip. I tried below command: $ pip install tensorflow &ndash;user But I got below error: Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow How can I install the TensorFlow?
asked Feb 19, 2020 mphil 2.3k points
0 votes
2 answers 608 views
608 views
Problem : In the MacOS Mojave terminal I am trying to install a python package with pip. At the end of it says as follows : You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Here ... to do.Also I just realized that it says Python 2.7 in the error message but I have python 3 and want to use only python 3.
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 138 views
138 views
Problem : When I try to install PyGame with:pip install pygame i am getting below error python could not find a version that satisfies the requirement
asked Oct 22, 2019 peterlaw 6.9k points