SublimeCodeIntel Canopy modules autocompletion - macos

I am using Sublime Text 3 with CodeIntel plugin on OSX Mavericks. I have installed Canopy and set the env so that I can simply use it from Terminal.app. In Sublime, I want the Canopy's modules to be recognized and auto-completed as I type. So far it only works for python packages OSX comes with. For example when I do
import
CodeIntel makes an autocompletion list and Sublime shows this popup, but this list does not include any Canopy modules such as pandas, even though they are installed. To proove I have a working pandas I did:
import pandas; help(pandas)
and hit Build in Sublime. It showed me help documentation of pandas. In addition, when I do:
import sys; print(sys.path)
it shows me canopy paths.
I have read about .codeintel/config file and tried various paths such as adding the /Library/path to Canopy lib/site-packages. in pythonExtraPaths in .codeintel/config , but it did not resolve the issue.
If you have any recommendations or previous relevant experience about this issue, it would be great. Thanks in advance.

Canopy is a virtual env, so you could search for "sublime virtualenv", or click this:
http://matthewphiong.com/sublime-codeintel-configuration-for-virtualenv

Related

Biopython, import error with "import Bio"

I have installed Biopython by Anaconda on Windows.
When I try import Bio I get this error:
ModuleNotFoundError: No module named 'Bio'
Why?
Simone.. it looks like your installation did go wrong somehow. Regardless of why and how try the following stepwise approach to see if your import error remains.
On Windows (the dots denote your installed program path specifics):
e.g. go to: C:\....\Anaconda...\Lib\site-packages
find and remove folders using delete.
folder 1: "\Bio"
folder 2: "\biopython-1.70.dist-info"
The version value 1.70 might be 1.69 when using conda for installation.
Empty your trashbin. This way the system can't do tricks and recover or link to deleted files and folders.
Install pip if its not and grab it from here.
try pip install biopython --no-cache-dir
Voila! Hope it works now for you too... Enjoy!
In case its not check windows environment variables\path.. via control panel>advanced system settings to include PATH to site-packages. Or do similar on other OS.

Anaconda not importing package

I am trying to use gmplot, which I've downloaded via Conda.
It is showing up in the environments, and the package is in /anaconda/pkgs, so the files are there.
But when I try to import it when running something (I've tried in Spyder and in Jupyter off Anaconda) it says No module called gmplot.
I've looked all over other questions but can't find anything that makes it work... have tried playing with PYTHONPATH manager to assign something specific to gmplot, but no luck.
If it's showing up clearly in the environments, is there something I'm not doing to get it to then be import-able?

install pygtk for python 3.6.1 on Windows 10

Since PIL.ImageGrab() gave me some problems, I read further into the topic and it seems that gtk is the better solution for making Screenshots.
But I don't understand which packages are actually working and which are deprecated.
trying
pip install pygtk
gives me
ERROR: Could not import dsextras module: Make sure you have installed pygobject.
pygobject doesn't exist, installing gobject doesn't help.
I tried some variants of the module name like python3- or just 3 at the end, but I don't seem to get the right one.
The full chat session about this is here. The original solution can be read here, especially the comment made by #cdarke.
So anyway, the solution is to use Python3.5 intead of 3.6 or newer, at least until MSYS2 is updated.
As a sidenote, you really don't want to use pygtk (which is based on Gtk2). Use pygobject like such:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
for GTK+, you have to do the following:
from gi.repository import Gtk
and not:
import gtk

How to install Pygame on Portable Python 3.2.5.1

I know that similar- questions about installing modules in Portable Python have been
asked but I have looked at all of them and another website. I didn't have success.
For me, I wanted to install Pygame on Portable Python 3.2.5.1 (on a memory stick). I nearly
managed to install it successfully but when I typed import pygame into the shell window,
there was a weird error in one of the files, displayed in the shell. See image below:
Update: Portable Python at time of writing has been discontinued (not being developed anymore)
and there are other alternatives available in suggested links on their website or internet search
engine query results. I have managed to add the Pygame Python module to my version
of one of these continuing projects so this question is not of use to me anymore.
I had this same problem today. I may have managed it. This is what I did:
I installed pygame to an empty folder so I could see all the things it needed. this was two folders:
Include>pygame and
Lib>site-packages
I went to Lib>site-packages and copied all the things there, then pasted them into
G:\Portable Python 3.2.5.1\App\Lib\site-packages
I also copied all the things in:
G:\Include\pygame
and pasted them into:
G:\Portable Python 3.2.5.1\App\include
from a quick play, this seems to work.
Although it isn't really the proper answer I was looking for a while ago when I posted the question (how to install Pygame on Portable Python 3.2.5.1), I have a possible answer for my question that could work.
It is possible (although I haven't personally tested it yet) run a Python
program using Portable Python and with the Pygame library folder stored in the directory the program is stored in. Python's module search path includes the current directory (of the running file) so import pygame would import it.
This question is old and maybe this is a possibility that was not possible at this time but simply:
From a command prompt go to your Portable Python's python.exe folder with cd <path to Portable Python>\App\Python,
Run: .\python.exe -m pip install pygame,
Now you have pygame module installed, you can check in your <path to Portable Python>\App\Python\Lib\site-packages that you have now pygame.
Note: I used Portable Python from here, version 3.10.5 at the time I wrote this.

PyDev reports import error for installed modules in site-packages but does run the code

I've just started using PyDev for Python 2.7 on MacOS 10.8.3. The only problem I have is that for the line...
from PIL import Image
It reports "Unresolved import: Image". However, I can run the code from the command line and from within PyDev and the import works within the PyDev console.
I have both of...
/Library/Python/2.7/site-packages
/Library/Python/2.7/site-packages/PIL
...in the Preferences->PyDev->Interpreter-Python->Libraries section. I have run Apply, redone the whole thing, and tried a few other things that others have reported for problems that look similar. Does anyone know of any definitive way to fix this?
I've found two different ways to fix this:
Go to Preferences -> PyDev -> Interpreter - Python -> Forced Builtins, click "New..." and enter "PIL" (without the quotes). Click OK twice and restart Eclipse.
Change your import statement to "import Image" instead of "from PIL import Image".

Resources