CatMan
CatMan

Reputation: 203

Using Eric-IDE with pyenv in Linux

I want to install Eric with pip into a Linux environment set up with pyenv. The program works, but I can not see my packages. I can not see what the problem is.

Here is what I did

Now start Eric, start a program with the line import numpy and you will get a ModuleFileNotFound error. Programs with no external modules work fine. The PyPI page will not show the same list for "default" than pip list on the command line.

What could be the problem?

Upvotes: 2

Views: 853

Answers (1)

CatMan
CatMan

Reputation: 203

Eric-IDE is a great and fully open source environment for Python. It has stunningly comfortable and widely configurable features and offers a perfect workflow while being rather intuitive to use. Really a full blown IDE. Although I am not using QT (where it offers even more integration features) I am really glad to resolve this major show stopper I came across which was issues with pyenv. I found the solution for my problems and now can answer my own question. Maybe its useful for others.

  • Eric-IDE can be used well with pyenv in Linux.
  • Install Eric into an own virtualenv. And your programs in others. At least there is no need to install Eric into the OS system.
  • Eric has 2 dialogs in the "extra" menu dealing with Virtual Envs and one PyPI Window where your can list the installed packages per virtual env.

    • The "Manager"

      • Eric only recognizes automatically on virtualevn. This is the one where eric was installed. This is named , but you may change the name. I change it to "eric" in my installations to avod confusion. There is one setting in the related Edit Dialog saying "Global Environment". For the virtualenv where Eric is installed this is checked and works, even though its actually not the global (=system) environment. Maybe the change that in versions after 20.5, because it would be more logical if that checkbox would be unchecked.
      • Use the Add button to enter data of other virtual environments you have on your system. It does matter which folders you enter as it might not see your packets when you entered the wrong folder (e.g. wrong folder for the "Interpreter"). Following is what is correct for a standard pyenv virtualenv created with "pyenv virtualevn 2.8.18 pythonLegacy" in Ubuntu 18.04. When you point the Interpreter path to the actual python installation Eric will not see your packages. It only works if you point to the symlink as in the example.
        Logical Name        pythonLegacy
        Directory          
                        /home/user/.pyenv/versions/pythonLegacy/lib/python2.7/site-packages
        Python Interpreter  /home/user/.pyenv/versions/pythonLegacy/bin/python2.7
        All options         unchecked
        PATH Prefix         <empty>
        
      • if you add the OS system environment you must check the "Global Environment" checkbox. It will work as expected.
    • The "Configuration"

      • the name is misleading, because this dialog allows you to create a new virtual env from within Eric IDE.
      • Please be careful what you enter, because it will write (or overwrite) data in your pyenv folder. As there is not documentation about this dialog, its a good idea to backup your " ~/.pyenv" (or whatever) pyenv home folder before testing what settings it needs.

PS: I would hope more people start using this, so the default Ubuntu repositories would start upgrading the package. Currently it is not among the maintained ones.

Upvotes: 1

Related Questions