[SciPy-User] How to install scipy in virtualenv+python3+unbuntu12.04?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] How to install scipy in virtualenv+python3+unbuntu12.04?

Heng Zhou
I want to install scipy in virtualenv and I'm using python3 and the OS is
ubuntu 12.04. Because virtualenv use pip to install third-party packages,
apt-get is not applicable. I read the install webpage but couldn't
understand what it is talking about. So, could you please give me a list of
workable command lines that I can follow to install scipy in
virtualenv+python3+unbuntu12.04? In addition, if there is any depandencies
needed before installation of scipy, please also included. Thank you very much.

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: How to install scipy in virtualenv+python3+unbuntu12.04?

Andreas Hilboll
On 20.11.2013 12:09, Heng Zhou wrote:
> I want to install scipy in virtualenv and I'm using python3 and the OS is
> ubuntu 12.04. Because virtualenv use pip to install third-party packages,
> apt-get is not applicable. I read the install webpage but couldn't
> understand what it is talking about. So, could you please give me a list of
> workable command lines that I can follow to install scipy in
> virtualenv+python3+unbuntu12.04? In addition, if there is any depandencies
> needed before installation of scipy, please also included. Thank you very much.

You can actually create a virtualenv which uses the global
site-packages, so the following should work:

   sudo apt-get install python3-scipy
   virtualenv --system-site-packages path/to/my/virtualenv

Otherwise, if you don't want --system-site-packages, you can just do the
standard

   virtualenv path/to/my/virtualenv
   source path/to/my/virtualenv/bin/activate
   pip install scipy


Cheers, Andreas.
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: How to install scipy in virtualenv+python3+unbuntu12.04?

Evgeni Burovski
In reply to this post by Heng Zhou

An easy trick is to first install it system-wide using apt-get to satisfy non-python dependencies, then install it manually in virtualenv, run the test suite to make sure it works all right. After that apt-get remove packages installed in step one.

Evgeni

On Nov 20, 2013 11:21 AM, "Heng Zhou" <[hidden email]> wrote:
I want to install scipy in virtualenv and I'm using python3 and the OS is
ubuntu 12.04. Because virtualenv use pip to install third-party packages,
apt-get is not applicable. I read the install webpage but couldn't
understand what it is talking about. So, could you please give me a list of
workable command lines that I can follow to install scipy in
virtualenv+python3+unbuntu12.04? In addition, if there is any depandencies
needed before installation of scipy, please also included. Thank you very much.

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: How to install scipy in virtualenv+python3+unbuntu12.04?

Thomas Kluyver-2
On 20 November 2013 03:39, Evgeni Burovski <[hidden email]> wrote:
An easy trick is to first install it system-wide using apt-get to satisfy non-python dependencies, then install it manually in virtualenv, run the test suite to make sure it works all right. After that apt-get remove packages installed in step one.

You probably want to 'apt-get build-dep python3-scipy', rather than simply installing it. That will install the packages required to compile it, whereas installing it will only get runtime dependencies.

Thomas

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: How to install scipy in virtualenv+python3+unbuntu12.04?

Heng Zhou
Thomas Kluyver <takowl <at> gmail.com> writes:

>
>
>
> On 20 November 2013 03:39, Evgeni Burovski <evgeny.burovskiy <at>
gmail.com> wrote:An easy trick is to first install it system-wide using apt-
get to satisfy non-python dependencies, then install it manually in
virtualenv, run the test suite to make sure it works all right. After that
apt-get remove packages installed in step one.
>
>
>
>
> You probably want to 'apt-get build-dep python3-scipy', rather than
simply installing it. That will install the packages required to compile
it, whereas installing it will only get runtime dependencies.

>
> Thomas
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

Thank you, but, after excuting the following commands (in order) in
virtualenv:

sudo apt-get install python3-scipy
sudo apt-get build-dep python3-scipy
sudo pip install scipy

, I did successfully installed scipy because I was told "Successfully
installed scipy". But in python3, when I input "import scipy", an error
says "ImportError: No module named scipy". Could you please tell me if I
missed something? Should I apt-get remove the global package? Thanks a lot!

Heng



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: How to install scipy in virtualenv+python3+unbuntu12.04?

Andreas Hilboll
On 20.11.2013 23:15, zzzhhh wrote:

> Thomas Kluyver <takowl <at> gmail.com> writes:
>
>>
>>
>>
>> On 20 November 2013 03:39, Evgeni Burovski <evgeny.burovskiy <at>
> gmail.com> wrote:An easy trick is to first install it system-wide using apt-
> get to satisfy non-python dependencies, then install it manually in
> virtualenv, run the test suite to make sure it works all right. After that
> apt-get remove packages installed in step one.
>>
>>
>>
>>
>> You probably want to 'apt-get build-dep python3-scipy', rather than
> simply installing it. That will install the packages required to compile
> it, whereas installing it will only get runtime dependencies.
>>
>> Thomas
>>
>>
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User <at> scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>
> Thank you, but, after excuting the following commands (in order) in
> virtualenv:
>
> sudo apt-get install python3-scipy
> sudo apt-get build-dep python3-scipy
> sudo pip install scipy
>
> , I did successfully installed scipy because I was told "Successfully
> installed scipy". But in python3, when I input "import scipy", an error
> says "ImportError: No module named scipy". Could you please tell me if I
> missed something? Should I apt-get remove the global package? Thanks a lot!
>
> Heng
>
>
>
> _______________________________________________
> SciPy-User mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

Don't do "sudo pip install scipy". Do "pip install scipy" within the
virtualenv (i.e. after executing "source /path/to/venv/bin/activate". If
you call "sudo pip install scipy", the root user executes "pip install
scipy", and the root user doesn't have the virtualenv enabled.

Cheers, Andreas.

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: How to install scipy in virtualenv+python3+unbuntu12.04?

Heng Zhou
Andreas Hilboll <lists <at> hilboll.de> writes:

>
> On 20.11.2013 23:15, zzzhhh wrote:
> > Thomas Kluyver <takowl <at> gmail.com> writes:
> >
> >>
> >>
> >>
> >> On 20 November 2013 03:39, Evgeni Burovski <evgeny.burovskiy <at>
> > gmail.com> wrote:An easy trick is to first install it system-wide using
apt-
> > get to satisfy non-python dependencies, then install it manually in
> > virtualenv, run the test suite to make sure it works all right. After
that
> > apt-get remove packages installed in step one.
> >>
> >>
> >>
> >>
> >> You probably want to 'apt-get build-dep python3-scipy', rather than
> > simply installing it. That will install the packages required to
compile

> > it, whereas installing it will only get runtime dependencies.
> >>
> >> Thomas
> >>
> >>
> >>
> >> _______________________________________________
> >> SciPy-User mailing list
> >> SciPy-User <at> scipy.org
> >> http://mail.scipy.org/mailman/listinfo/scipy-user
> >>
> >
> > Thank you, but, after excuting the following commands (in order) in
> > virtualenv:
> >
> > sudo apt-get install python3-scipy
> > sudo apt-get build-dep python3-scipy
> > sudo pip install scipy
> >
> > , I did successfully installed scipy because I was told "Successfully
> > installed scipy". But in python3, when I input "import scipy", an error
> > says "ImportError: No module named scipy". Could you please tell me if
I
> > missed something? Should I apt-get remove the global package? Thanks a
lot!

> >
> > Heng
> >
> >
> >
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User <at> scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> >
>
> Don't do "sudo pip install scipy". Do "pip install scipy" within the
> virtualenv (i.e. after executing "source /path/to/venv/bin/activate". If
> you call "sudo pip install scipy", the root user executes "pip install
> scipy", and the root user doesn't have the virtualenv enabled.
>
> Cheers, Andreas.
>

Thank you very much! I finally made it! Thank Andreas Hilboll, thank Thomas
Kluyver, thank Evgeni Burovski, thank everyone who helped me, I loved you!

Here I summarize all the steps as follows:

In ubuntu 12.04 server that comes only with python 2.7, to install a
python3 virtual environment that doesn't conflict with python2, and scipy
package that can be used by python3, run the following commands:

sudo apt-get install python-pip
sudo pip install virtualenv
sudo apt-get install python3
virtualenv -p /usr/bin/python3 py3env
. py3env/bin/activate
sudo apt-get install python3-scipy
sudo apt-get build-dep python3-scipy
pip install numpy
pip install scipy

Now you are all set. Finally a small hint: to find where the python3 is,
type: whereis python3.

Thank you all again!

Heng Zhou






_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user