I hope it is just that I am doing something stupid but for some reason Komodo wont see a modules I have on my machine. I used PIP to install paramiko and it installed fine. From a terminal the builtin python and ipython will see and import the module fine. When I am trying to write a Python script and I try to import paramiko, Komodo thins its not there at all. I am not sure what to do to fix this.
I did instal some other items from pip and Komodo sees them right away but for what ever reason it wont see paramiko. I will try this on Windwos and Linux to make sure its not just my setup. I hope someone can help me out on this.
I am using the Komodo editor under Linux, so I hope I am not pointing you to a place that does not exist in the IDE, but I hardly doubt it.
So, have you tried adding the module in Komodo:
preferences --> languages --> python --> additional python import directories
This might work.
Joren basically got it but I added the entire "site-packages" folder to Edit (Komodo on OS X) > Preferences > Languages > Python: Additional Python Import Directories, reason being that I hit the issue with other modules.
You shouldn't need to do that obviously. There is a bug filed and it should be fixed soon: http://bugs.activestate.com/show_bug.cgi?id=99829
Related
I'm a python noob working through this intro to python: https://www.youtube.com/watch?v=rfscVS0vtbw. (definitely no need to watch this. Just adding it as context)
It's been going really well, except now I'm up to the part where I need to use pip, and despite having downloaded version 3.8 of Python, it keeps telling me that it doesn't even have pip installed.
I'm wondering if anyone could walk me through what the issue might be and how to actually start using pip in PyCharm.
I've tried downloading pip and installing it but even that doesn't seem to work. If anyone has an ultra-hand-holdy solution (very much for a noob) that would be appreciated.
I feel like the problem might be that I'm putting things in the wrong directories or something? Obviously there are some built-in versions on Python (2.x) already on the Mac so maybe they are interfering?
Thanks in advance for your help.
If I recall correctly, the version of Python that is used when you use the command python is the 2.x version, which doesn't have pip. So if you want to use python in terminal, you should call it as python3 and pip3 for using the pip command.
If you want to set a different Python version as the default one, you can do that. Here is a tutorial that can get you started with that (there's a plethora of other tutorials if this one isn't clear enough): https://opensource.com/article/19/5/python-3-default-mac
For using PyCharm specifically, you can setup the Python interpreter that is used with PyCharm by going to Preferences(or Settings) -> Project:[name of your project] -> Project Interpreter and then chose the desired Python Interpreter from the drop down menu. You can also create a virtual environment there by clicking on the cog icon and choosing Add. This is the preferred way and very convenient to keep installed packages local to your project. After you're done with that, open up PyCharms terminal (at the bottom of your PyCharm window) and you should be able to normally use pip with the command pip.
Alternatively, you can install Python packages in PyCharm using their built in package manager that you can find in the same window where you set your Python Interpreter. Below the dropdown menu you'll see a + sign, where you can click to add packages.
I am very new to Python and am trying to learn it so that I can write Mercurial hooks (https://www.mercurial-scm.org/wiki/MercurialApi).
I downloaded PyCharm by Jetbrains with the hope that I could start writing a python script and have the IDE autocomplete for me so I could see what available functions objects have etc. I started with this:
#!/usr/bin/env python
from mercurial import ui, hg
# change . to the path to the repo
repo = hg.repository(ui.ui(), '.')
ui.warn('asdfsadf')
However, as no Python Interpreter is configured, I can't autocomplete (or, at least that's what I think the issue is). I do have Mercurial installed, and when I do pip list I do see the library listed, but PyCharm doesn't know about it. How do I configure thing so that the libraries I want recognized by the IDE get recognized? I know that there are settings which can be set, but I don't understand which ones I want for my purpose.
I found that this post How do I import modules in pycharm? helped me a lot to add the appropriate project interpreter.
I have Anaconda2 running smoothly on Eclipse's PyDev environment.
I have received a custom package from a colleague in the form of a folder with a "library" sub-directory that contains many ".pyc" files (which I presume are the function files) and a "init.py" file. But no matter what I do, I cannot seem to install the folder as a package.
I have tried everything posted here in the Anaconda Prompt (which I'm assuming was the correct way of implementing the instructions)
http://conda.pydata.org/docs/using/pkgs.html#install-non-conda-packages
but nothing worked.
I am very new to really working with Anaconda, Python, Eclipse, and PyDev (I have only written simple scripts with the default IDLE IDE in the past).
All I really want to be able to do is to use the package of functions given to me - even if they are not properly "installed", although that would be ideal. If anyone out there can help me with this I would be very grateful!
Pyc are precompiled files, you dont need them.
You should simply import package folder with
import folder-name
I primarily use PyCharm but when I try to develop using IDLE it doesn't recognise any of my packages / folders. Even though they have a __init__.py file in them, any reason why and how can I fix it?
Thanks for any help, I can provide more information as and when it is needed.
My guess is you have multiple versions of python, and Pycharm is using a different one than the version of IDLE you're using. It could also be that some packages like Pygame only work in 32 bit versions...
I don't know why after a year this suddenly became an issue, but I pip-installed requests and I got an import error when running from Sublime, but it worked fine in the terminal.
I dug a little and found that the terminal was running Python 2.7.3 from /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python (where requests worked) and Sublime was using 2.7.2 from /usr/bin/python. That's where my know-how ends, and this is an area I'm reluctant to fiddle with if I don't know what I'm doing. I'm using OSX 10.8.2. Any suggestions? Not even sure what to Google.
Since you are using a newer, non-system Python (which is a good idea), you need to tell Sublime Text 2 to use that Python. Although your shell $PATH was modified to include the location of the newer Python, Sublime Text doesn't know about that. See this answer for various ways to do that.
You need to start using virtualenv and virtualenvwrapper when developing. It gives you a sandboxed python environment for each of your projects.
I was led to this question/answer (by the above Ned Deily, no less) that solved everything. Hope it helps someone else! (Ned, would love to give you the karma, but at 26.7k it doesn't look like you're in dire need).
How to uninstall Python 2.7 on a Mac OS X 10.6.4?