Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #12529 > unrolled thread

issues installing psutil with pip in virtual environment

Started byAnil F Duggirala <anilduggirala@fastmail.fm>
First post2020-04-26 18:30 +0200
Last post2020-04-26 18:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.debian.maint.python


Contents

  issues installing psutil with pip in virtual environment Anil F Duggirala <anilduggirala@fastmail.fm> - 2020-04-26 18:30 +0200
    Re: issues installing psutil with pip in virtual environment Sandro Tosi <morph@debian.org> - 2020-04-26 18:40 +0200
    Re: issues installing psutil with pip in virtual environment Scott Kitterman <debian@kitterman.com> - 2020-04-26 18:40 +0200

#12529 — issues installing psutil with pip in virtual environment

FromAnil F Duggirala <anilduggirala@fastmail.fm>
Date2020-04-26 18:30 +0200
Subjectissues installing psutil with pip in virtual environment
Message-ID<zZSki-322-11@gated-at.bofh.it>
hello,
I am running into an issue installing psutil: pip3 install psutil, in a
virtual environment. I have upgraded my pip and setuptools with no
avail. I am getting this error: https://pastebin.com/2Xb7UN9g
Some have suggested installing the python3-dev package. Saying that I
require "header" files (don't know what those are). So this means
installing that package and creating a new venv, where those files are
available. Is there a way to make this install work without installing
that package? Is that package really necessary? Does this mean my
virtual environments are somehow subject to what libraries are
available in my system python installation? Is there some pip
installabel package that provides these files?
thank you,

[toc] | [next] | [standalone]


#12530

FromSandro Tosi <morph@debian.org>
Date2020-04-26 18:40 +0200
Message-ID<zZStX-35n-1@gated-at.bofh.it>
In reply to#12529
> I am running into an issue installing psutil: pip3 install psutil, in a
> virtual environment. I have upgraded my pip and setuptools with no
> avail. I am getting this error: https://pastebin.com/2Xb7UN9g

psutil is not pure python, and contains some extensions that need to
be compiled, so your system needs to have a compiler, gcc, installed;
since it's not you get "unable to execute 'x86_64-linux-gnu-gcc': No
such file or directory"

> Some have suggested installing the python3-dev package. Saying that I
> require "header" files (don't know what those are). So this means
> installing that package and creating a new venv, where those files are
> available. Is there a way to make this install work without installing
> that package? Is that package really necessary? Does this mean my

you will necessarily need to install python3-dev

> virtual environments are somehow subject to what libraries are
> available in my system python installation?

yes, in a similar way as they are dependent on the system interpreter
to create and run the venv

> Is there some pip
> installabel package that provides these files?

some packages on PyPI provide binary releases, but psutil looks like
it doesnt for linux, so you need to compile it.

alternatively you can install python3-psutil on your host and then
"virtualenv --system-site-packages" to use the system-available
modules.

Regards,
-- 
Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
Twitter: https://twitter.com/sandrotosi

[toc] | [prev] | [next] | [standalone]


#12531

FromScott Kitterman <debian@kitterman.com>
Date2020-04-26 18:40 +0200
Message-ID<zZStY-35n-11@gated-at.bofh.it>
In reply to#12529

On April 26, 2020 4:06:00 PM UTC, Anil F Duggirala <anilduggirala@fastmail.fm> wrote:
>hello,
>I am running into an issue installing psutil: pip3 install psutil, in a
>virtual environment. I have upgraded my pip and setuptools with no
>avail. I am getting this error: https://pastebin.com/2Xb7UN9g
>Some have suggested installing the python3-dev package. Saying that I
>require "header" files (don't know what those are). So this means
>installing that package and creating a new venv, where those files are
>available. Is there a way to make this install work without installing
>that package? Is that package really necessary? Does this mean my
>virtual environments are somehow subject to what libraries are
>available in my system python installation? Is there some pip
>installabel package that provides these files?
>thank you,

No.  No.  Yes.  Yes.  No.

Pip doesn't provide the python interpreter.  The solution is in the traceback you posted:

("sudo apt-get install gcc python%s-dev" % py3)
      File "/tmp/pip-install-b88905i2/psutil/setup.py", line 116, in missdeps
        s = hilite("C compiler or Python headers are not installed ", ok=False)

So install gcc and python3-dev and try again.

Scott K

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web