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;








3















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.










share|improve this question






















  • 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

















3















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.










share|improve this question






















  • 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













3












3








3








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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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

















  • 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
















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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved