I have accidentally deleted my Python modules such as the random and turtle module from a Windows 7 machine. I am unsure on how to reinstall them.
you will have to uninstall and download python again but if you save the files to a secure area you will still have them.
You have to go to the settings in there and if there is no way of finding them then you can go onto the python website and reinstall them from there :-)
Related
I would like to add the pygame and PIL modules as files in my project. My goal is to not have to install them by typing pip install in the console prompt. So I'm looking for a way to physically add them in the project directory. Thank you.
I'm quite sure you don't really want to do this, since both the modules you listed have binary components specific to Python and OS version/architecture. You'd have to ship all of them, for all versions you expect to run your project on.
Just add instructions on how to install them, instead.
I'm making a program that uses PyMySql and I'd like people to be able to run my program without going through the manual installation of PyMySql, is there a way I can achieve that?
I've already tried compiling to .pyc but that doesn't seem to work, in fact when I uninstall PyMySql it doesn't work anymore.
PS: There probably are better languages to do that but it's a homework assignment for school and can't use anything but python, also sorry for my bad english
Since PyMySQL has MIT license, you can redistribute it without any legal issues and also is a pure python implementation so it doesn't matter on which operative system it runs.
Just go to your python library folder and look for the module folder and copy it to your project folder, after that you can uninstall and python should be able to import it from your project folder and you just need to send your assignment with the module included.
The python library folder varies depending on your operative system, you can look at this answer on how to find the module location.
Use cx_freeze, pyinstaller or virtualenv.
Or copy code and put in your. Read python import
I'm having a problem installing python packages and I think it has to do with the fact that I apparently have 4 Python directories. I can download and install them without a problem using pip... but when trying to import them in an IDE they don't appear.
Any help would be appreciated and I should say that I'm a complete beginner.
That's a really tricky issue specific to OS X, and also hard to fix. The root cause is the fact the GUI apps and console apps do not share the same environment (with things like PATH and PYTHONPATH).
Read https://stackoverflow.com/a/588442/99834
I use windows 7 and I've had problems with viruses. Using eset nod 32 and malwarebite anti-malware I've managed to clean everything up. But now I can't open Python (neither Spyder nor ipython notebook...). Nod 32 tells me that there are some files that are damaged and can not be open in anaconda.
I've tried uninstalling and reinstalling python, and googling my issue hasn't turned up anything. Has anyone else had this problem?
Remove previous installation of python, download the latest, install and attempt to launch python again.
https://www.python.org/downloads/
It could be that your anti-virus is false-identifying some python files as malicious, or perhaps you aren't installing python as administrator.
Perhaps python isn't on your path.
What happens when you open up your cmd.exe or powershell.exe program and run
python
How did you uninstall python? By deleting the folder? Don't do that, there may be other data from it on your computer. Instead, go to add or remove programs and uninstall it from there (may be slightly different on Windows 7 beecause I am using 8.1)
Now, with your viruses, I would suggest that you take a hard drive and save the folders that you KNOW do not have viruses. This means folders that you made yourself, not ones that another application made for you. Back them up, then restore your computer to factory settings. This should erase all the viruses.
I have a problem when trying to install Pygame. My Python is installed under Program Files in the C drive (C:\Program Files\Python). My registry wont show, and I have no idea what I shall do. Should it go under site-packages or what? Believe me, I've been searching around for ages in order to solve this. Please come with specific steps on what I shall do. Sorry, I'm new to this (as you can see). Correct me if I use registry wrong :)
First visit here.
Be sure that you have installed numpy properly and then check once more that you have downloaded the proper pygame binary for your specific OS (x32, x64).
If everything of the above fails, un-install python and reinstall it (again using the proper version).
I had some similar issues with PIL and after reinstalling python it fixed.
For picture issue: You can upload it to your dropbox or google drive and share here the link.
Edit: Be sure that python is in the environment variables path of windows
edit2: which version of python do you use. Python 2.x has some incoherences with python 3.x so check that too.