Python module install: specifying location of external library dependencies Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience Should we burninate the [wrap] tag? The Ask Question Wizard is Live!Calling an external command in PythonHow can I get a list of locally installed Python modules?pip install mysql-python fails with EnvironmentError: mysql_config not foundHow to install psycopg2 with “pip” on Python?python pip specify a library directory and an include directoryPython unable to locate gmpy libraryHow do I install a Python package with a .whl file?python install module apiclientWhy are different python modules installed in different locations?pip not installing all dependencies in setup.py
Coloring maths inside a tcolorbox
3 doors, three guards, one stone
What would be the ideal power source for a cybernetic eye?
Why is "Consequences inflicted." not a sentence?
Fundamental Solution of the Pell Equation
Apollo command module space walk?
Why are Kinder Surprise Eggs illegal in the USA?
Is the Standard Deduction better than Itemized when both are the same amount?
How does debian/ubuntu knows a package has a updated version
How to call a function with default parameter through a pointer to function that is the return of another function?
Single word antonym of "flightless"
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Why light coming from distant stars is not discreet?
How to answer "Have you ever been terminated?"
How come Sam didn't become Lord of Horn Hill?
What is Arya's weapon design?
Do I really need recursive chmod to restrict access to a folder?
Can a non-EU citizen traveling with me come with me through the EU passport line?
How to align text above triangle figure
How to deal with a team lead who never gives me credit?
The logistics of corpse disposal
Why aren't air breathing engines used as small first stages
Can I cast Passwall to drop an enemy into a 20-foot pit?
Python module install: specifying location of external library dependencies
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
Should we burninate the [wrap] tag?
The Ask Question Wizard is Live!Calling an external command in PythonHow can I get a list of locally installed Python modules?pip install mysql-python fails with EnvironmentError: mysql_config not foundHow to install psycopg2 with “pip” on Python?python pip specify a library directory and an include directoryPython unable to locate gmpy libraryHow do I install a Python package with a .whl file?python install module apiclientWhy are different python modules installed in different locations?pip not installing all dependencies in setup.py
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
The pip
tool makes python module install a breeze -- for the most part. But when the module requires some external C libraries that are not found in "standard locations", it can cause problem. Case in point: I was trying to install gmpy2
python module, and it needs to have access to gmp
, mpfr
, and mpc
libraries. On the system I'm using (Linux HPC, running RHEL 6.9), the system-wide libraries are very old. The HPC system admin provides more up-to-date libraries but not in /usr/lib
or /usr/local/lib
. My question is: can we still use pip to build binary parts of the Python module? How to specify the custom include & library files location? I was forced to get back to python setup.py
approach: first using build_ext
subcommand, then invoking the install
subcommand to finish the install. This is workable, but rather messy.
python pip
add a comment |
The pip
tool makes python module install a breeze -- for the most part. But when the module requires some external C libraries that are not found in "standard locations", it can cause problem. Case in point: I was trying to install gmpy2
python module, and it needs to have access to gmp
, mpfr
, and mpc
libraries. On the system I'm using (Linux HPC, running RHEL 6.9), the system-wide libraries are very old. The HPC system admin provides more up-to-date libraries but not in /usr/lib
or /usr/local/lib
. My question is: can we still use pip to build binary parts of the Python module? How to specify the custom include & library files location? I was forced to get back to python setup.py
approach: first using build_ext
subcommand, then invoking the install
subcommand to finish the install. This is workable, but rather messy.
python pip
I do not know, what locations Python is looking by default, but what if you have those paths included in bash variable LD_LIBRARY_PATH? Aren't the programs usually searching for libraries using those locations as well?
– msi_gerva
Mar 8 at 21:18
Yes,LD_LIBRARY_PATH
is searched for running the library. But for building, one has to useLIBRARY_PATH
(at least for GNU toolchain?). For the compilation phase though, there is no such an alternative way of specifying path, AFAIK, other than the-I
flags. Then maybe one has to useCFLAGS
andLDFLAGS
to begin with.
– Wirawan Purwanto
Mar 10 at 21:40
add a comment |
The pip
tool makes python module install a breeze -- for the most part. But when the module requires some external C libraries that are not found in "standard locations", it can cause problem. Case in point: I was trying to install gmpy2
python module, and it needs to have access to gmp
, mpfr
, and mpc
libraries. On the system I'm using (Linux HPC, running RHEL 6.9), the system-wide libraries are very old. The HPC system admin provides more up-to-date libraries but not in /usr/lib
or /usr/local/lib
. My question is: can we still use pip to build binary parts of the Python module? How to specify the custom include & library files location? I was forced to get back to python setup.py
approach: first using build_ext
subcommand, then invoking the install
subcommand to finish the install. This is workable, but rather messy.
python pip
The pip
tool makes python module install a breeze -- for the most part. But when the module requires some external C libraries that are not found in "standard locations", it can cause problem. Case in point: I was trying to install gmpy2
python module, and it needs to have access to gmp
, mpfr
, and mpc
libraries. On the system I'm using (Linux HPC, running RHEL 6.9), the system-wide libraries are very old. The HPC system admin provides more up-to-date libraries but not in /usr/lib
or /usr/local/lib
. My question is: can we still use pip to build binary parts of the Python module? How to specify the custom include & library files location? I was forced to get back to python setup.py
approach: first using build_ext
subcommand, then invoking the install
subcommand to finish the install. This is workable, but rather messy.
python pip
python pip
asked Mar 8 at 17:43
Wirawan PurwantoWirawan Purwanto
1,21111420
1,21111420
I do not know, what locations Python is looking by default, but what if you have those paths included in bash variable LD_LIBRARY_PATH? Aren't the programs usually searching for libraries using those locations as well?
– msi_gerva
Mar 8 at 21:18
Yes,LD_LIBRARY_PATH
is searched for running the library. But for building, one has to useLIBRARY_PATH
(at least for GNU toolchain?). For the compilation phase though, there is no such an alternative way of specifying path, AFAIK, other than the-I
flags. Then maybe one has to useCFLAGS
andLDFLAGS
to begin with.
– Wirawan Purwanto
Mar 10 at 21:40
add a comment |
I do not know, what locations Python is looking by default, but what if you have those paths included in bash variable LD_LIBRARY_PATH? Aren't the programs usually searching for libraries using those locations as well?
– msi_gerva
Mar 8 at 21:18
Yes,LD_LIBRARY_PATH
is searched for running the library. But for building, one has to useLIBRARY_PATH
(at least for GNU toolchain?). For the compilation phase though, there is no such an alternative way of specifying path, AFAIK, other than the-I
flags. Then maybe one has to useCFLAGS
andLDFLAGS
to begin with.
– Wirawan Purwanto
Mar 10 at 21:40
I do not know, what locations Python is looking by default, but what if you have those paths included in bash variable LD_LIBRARY_PATH? Aren't the programs usually searching for libraries using those locations as well?
– msi_gerva
Mar 8 at 21:18
I do not know, what locations Python is looking by default, but what if you have those paths included in bash variable LD_LIBRARY_PATH? Aren't the programs usually searching for libraries using those locations as well?
– msi_gerva
Mar 8 at 21:18
Yes,
LD_LIBRARY_PATH
is searched for running the library. But for building, one has to use LIBRARY_PATH
(at least for GNU toolchain?). For the compilation phase though, there is no such an alternative way of specifying path, AFAIK, other than the -I
flags. Then maybe one has to use CFLAGS
and LDFLAGS
to begin with.– Wirawan Purwanto
Mar 10 at 21:40
Yes,
LD_LIBRARY_PATH
is searched for running the library. But for building, one has to use LIBRARY_PATH
(at least for GNU toolchain?). For the compilation phase though, there is no such an alternative way of specifying path, AFAIK, other than the -I
flags. Then maybe one has to use CFLAGS
and LDFLAGS
to begin with.– Wirawan Purwanto
Mar 10 at 21:40
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068366%2fpython-module-install-specifying-location-of-external-library-dependencies%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068366%2fpython-module-install-specifying-location-of-external-library-dependencies%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I do not know, what locations Python is looking by default, but what if you have those paths included in bash variable LD_LIBRARY_PATH? Aren't the programs usually searching for libraries using those locations as well?
– msi_gerva
Mar 8 at 21:18
Yes,
LD_LIBRARY_PATH
is searched for running the library. But for building, one has to useLIBRARY_PATH
(at least for GNU toolchain?). For the compilation phase though, there is no such an alternative way of specifying path, AFAIK, other than the-I
flags. Then maybe one has to useCFLAGS
andLDFLAGS
to begin with.– Wirawan Purwanto
Mar 10 at 21:40