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...
Related
i've created a student-managing-software for linux which use different packages (tkmessageboxes, glade-builder, gtk3+). Now, there are a lot of people how asked how it can be used under windows but i've no idea. So, does someone know how to use these packages under windows or is it impossible? THX
Well I would say it is up to the developer to make an actual installer for it, but you can get all of the dependencies through the MSYS2 project.
I installed Python 3.5 from source and broke a number of modules on Python 3.4, which unfortunately, was an essential part of Ubuntu. I've been trying to fix the system, now I'm almost there, with (hopefully) the last problem: My Python 3.4 only recognize C modules with name *.cpython-34m.so, while all packages from Ubuntu repository are named *.cpython-34m-x86_64-linux-gnu.so. It seems that the cpython-34m stuff is the full name of Python, so I need to change it in accord with Ubuntu's expectation. How can I achieve this?
What you are trying makes no sense. The name cannot be changed, for a good reason. The reason the names are different is to prevent incompatible versions from mixing up each other. You can compile a different version with different options and then the name will be different, too.
The essence of the package management is to satisfy all dependencies through the repositories. Theoretically there should be no need to install anything from the sources.
If you need a different Python version for some specifical reasons, virtual environments would be the thing to look for:
http://docs.python-guide.org/en/latest/dev/virtualenvs/
I reinstalled Python 3.4 via Ubuntu package system, and suddenly everything worked fine. I still have no clue how Ubuntu customize its own Python, since Python's configure command has no related option at all. Anyway, it works, so why bother :P. Finally, thank you for helping me with this problem.
this is my first post and I've been working with python for about a month now.
Anyway I've been trying to import downloaded modules into python 2.7, such as django and mechanize, and I keep getting the same error telling me there is no such module. I downloaded both with pip and from I understand should be in the correct directories. A while ago I decided to simply copy and paste the django folder into the same folder I was saving my programs into, and that took care of the issue. That seems a bit messy though, having to save all of my modules into various folders. So I looked around stackoverflow (and elseware) and pasted that same folder into a PYTHONPATH directory and that didn't solve the problem either. I apologize for the long question but I've been at it for a while now and tried a few different fixes. Any feedback would be greatly appreciated, thank you very much.
On a side note, default modules work fine, such as: math and os. Side note, I'm running kubuntu 14.04.
Thanks again.
The standard Python solution to installing packages is to install pip (package manager) and virtualenv, then make a virtualenv for each project and install your packages in the virtualenv. The documentation for those projects is quite good and should be able to get you started.
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
I have been trying to graph with python for some time now. I want to use matplotlib, but have hit so many bumps in the road. Previously, numpy and matplotlib have been installed, but I am stuck with this error: ImportError: numpy.core.multiarray failed to import. I'm running Lion on Mac. I think I'm using Python 2.7. I have also tried full walkthroughs, such as this as well: http://penandpants.com/2012/02/24/install-python/. After several installation methods like pip and homebrew I am afraid that there's a lot of knotted things going on with python on my computer. And I really don't know how to untangle it.
I am reasonably knowledgeable with programming and algorithms, but I lack the know-how on how all the add-ons such as matplotlib that connect with python or how a text editor that can execute my code like Sublime Text 2 accesses them. So, as much as I would like to aid this asking-a-question process by letting you know what versions I am using, I don't really know how. Any guidance to how python connects to these things would be really appreciated :)
Ultimately, I wish to start from scratch with this whole mess, reinstalling python and then matplotlib from the ground up--but I'm not totally sure how. So, I guess my final question is how do I do that, or if that is just a wrong line of thinking how do I proceed if I want to graph some mathy things with python?
Sorry for the long winded question, I'll appreciate any help even a nudge in the right direction in learning how my computer organizes python on my computer!
Thanks!
I've had similar problems and the best solution I found was to use MacPorts for managing python and my installed modules. The things that I particularly like about using MacPorts for this are:
You can easily install multiple python versions (with modules separately installed for each installation)
You can select which python installation is the default (whether it is one installed by MacPorts or your OS X python installation).
Many MacPorts packages have optional variants so you can easily customize how they are installed (e.g., should numpy use the ATLAS library from MacPorts or from OS X) .
If you screw up your installation, you can easily wipe MacPorts from your system without worrying about breaking anything (almost everything installed by MacPorts is put under /opt).