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


Groups > comp.lang.python > #66468

Re: Problem importing libraries installed with PIP in Eclipse

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <fabiofz@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'importing': 0.05; 'importerror:': 0.07; 'paths': 0.07; 'sys': 0.07; 'bits': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"from': 0.16; '(directly': 0.16; 'cc:name:python list': 0.16; 'eclipse': 0.16; 'fabio': 0.16; 'guys,': 0.16; 'numpy': 0.16; 'path.': 0.16; 'subject:Problem': 0.16; 'wrote:': 0.18; "python's": 0.19; 'feb': 0.22; '>>>': 0.22; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'error': 0.23; '&gt;&gt;&gt;': 0.24; 'format,': 0.24; 'please?': 0.24; 'cheers,': 0.24; 'cc:2**0': 0.24; 'script': 0.25; 'skip:" 40': 0.26; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'am,': 0.29; 'array': 0.29; 'related': 0.29; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'gives': 0.31; 'fine,': 0.31; 'libraries': 0.31; 'file': 0.32; 'url:python': 0.33; '(most': 0.33; 'fri,': 0.33; 'screen': 0.34; 'could': 0.34; 'problem': 0.35; 'subject:with': 0.35; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; '14,': 0.36; 'format.': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'error.': 0.37; 'skip:& 10': 0.38; 'recent': 0.39; 'url:mail': 0.40; 'new': 0.61; 'name': 0.63; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'url:png': 0.68; 'url:a': 0.72; 'skip:/ 30': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=AtDILJFf9DGaNDrWjW38EGbqVv/d7a2wCNEG11XpUfw=; b=XvvQX/wyAL/5xxAeQzAdB+SpZreYpI/6ySadpuFFB4XewnE6pd0zRvQsinK71szd/P IGGD7SjsoRu75UUP0bPeiDJZmUC+VT8nAv1+N2qGzwzjlefiaMDHkrD+wyvBKK8B0h6G ckSAgUbXksg8RAs+JfZoD1xe0xyq4jyAQNJCA4jfAewE9pNmGHO5lvaCxRQ17jtN2Anz ipUqWe3vAKj19jMHKkJ+5NqqvhFF3RfJrMmOD/tntJ2mW3laBaN6JPvg6zOcLKCn1ZBW 0POY1FjEsOtEF5HMHM2+hDWwC73CEWOfSWfDEk+kvTgRaGPRAicaCLGuna7AQSqJuLa2 OKLA==
X-Received by 10.52.251.232 with SMTP id zn8mr4939645vdc.41.1392488735489; Sat, 15 Feb 2014 10:25:35 -0800 (PST)
MIME-Version 1.0
In-Reply-To <3a3acbf3-a7a5-4a5f-9e6c-10b4640be17f@googlegroups.com>
References <3a3acbf3-a7a5-4a5f-9e6c-10b4640be17f@googlegroups.com>
From Fabio Zadrozny <fabiofz@gmail.com>
Date Sat, 15 Feb 2014 16:25:15 -0200
Subject Re: Problem importing libraries installed with PIP in Eclipse
To Renato <rvernucio@gmail.com>
Content-Type multipart/alternative; boundary=001a113404506ec7eb04f2760c9b
Cc python list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7015.1392488743.18130.python-list@python.org> (permalink)
Lines 127
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392488743 news.xs4all.nl 2916 [2001:888:2000:d::a6]:35365
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66468

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, Feb 14, 2014 at 1:30 AM, Renato <rvernucio@gmail.com> wrote:

> Hi guys, I'm using Python 2.7.5 64 bits and I have a problem when
> importing libraries that were installed via PIP when importing them inside
> Eclipse (version 4.3.1). Outside Eclipse (directly in Python's shell)
> everything works fine, here is an example:
>
> >>> import numpy                             # installed from repositories
> >>> from numpy import array
> >>> import pybrain                           # installed via PIP
> >>> from pybrain import Network
> >>>
>
> Everything works outside Eclipse. But inside Eclipse I can't import
> libraries installed via PIP using "from x import y" format, it will give an
> error. The only way I can import libraries installed via PIP is using
> "import x" format. Here is an example:
>
> import numpy                                     # no errors (installed
> from repositories)
> from numpy import array                          # no errors
> import pybrain                                   # no errors (installed
> via PIP)
> from pybrain import Network                      # gives the error below
>
> Traceback (most recent call last):
>   File "/media/arquivos/pybrain_import_test.py", line 4, in <module>
>     from pybrain import Network
> ImportError: cannot import name Network
>
> I suspected it could be related to virtualenv, but here is a print screen (
> http://imageshack.com/a/img534/4307/3x0m.png) of my Python's PATH. The
> directory /usr/lib/python2.7/site-packages where PyBrain is installed is
> already in Python's PATH inside Eclipse. Could someone help me, please?
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Hi Renato,

Can you do the following:

Create a new script with:

import sys
print '\n'.join(sorted(sys.path))

And let me know if the paths you have listed in both are equal... Also,
which version of PyDev are you using?

Cheers,

Fabio

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Problem importing libraries installed with PIP in Eclipse Renato <rvernucio@gmail.com> - 2014-02-13 19:30 -0800
  Re: Problem importing libraries installed with PIP in Eclipse Fabio Zadrozny <fabiofz@gmail.com> - 2014-02-15 16:25 -0200
  Re: Problem importing libraries installed with PIP in Eclipse Renato <rvernucio@gmail.com> - 2014-02-16 04:59 -0800
  Re: Problem importing libraries installed with PIP in Eclipse Renato <rvernucio@gmail.com> - 2014-02-16 06:52 -0800
    Re: Problem importing libraries installed with PIP in Eclipse Fabio Zadrozny <fabiofz@gmail.com> - 2014-02-17 16:07 -0300
    Re: Problem importing libraries installed with PIP in Eclipse Renato Vernucio <rvernucio@gmail.com> - 2014-02-17 16:20 -0300

csiph-web