Setting up python on external HDD (on MacOS) - python

I don't have access to current portable python solutions, and I'd like to put a bare bone python and manually add libs on an external HDD using a Mac.
I went to python.org but the .pkg file for Mac automatically installs python locally. I am wondering if there is a solution to what I am trying to do.

The .pkg installer clearly gives the option Change Install Location...:
Try clicking the button and selecting the external drive.

Related

How to install Python (any version) in Windows when you've no admin privileges?

The "NO ADMIN PRIVILEGES" part is key. I need to install Python but I do not have access to it in order to run the installation in a proper way. I'm also behind a firewall, so the "pip" option is quite limited.
Could you help me figure this out?
From the Python website, download the MSI version of Python you wish to install.
Then open your command prompt and use this command:
msiexec /a python-2.7.10.msi /qb TARGETDIR=C:\python27
Substitute python-2.7.10.msi, if you downloaded Python 3 and adjust your TARGETDIR to where you want it to go.
The /qb flag will give you a small dialog progress bar.
I downloaded embeddable zip file from the site. Extracted it to the folder of my choice. Then added that folder in the windows path variable (using setx). It worked for me. Well this install only python and not the other packages like pip etc.
Later I found better and simpler way with Python 3.7.0 version for windows.
Download windows installer exe.
Run the exe.
Screen will be shown to chose the installation option.
Uncheck "install for all users" option.
Go for the custom installation.
On next screen specify the directory path for which your user have
full access on the computer.
Uncheck "create shortcuts for installed application" option.
Make sure "Add python to environment variable" option is Unchecked .
complete the installation.
Add the installation and Script folder path in PATH using setx
This has installed all the default components of python
As the comment states: "uncheck '[Install launcher] for all users'"..
I suggest you use Anaconda (open source edition).
Anaconda is a completely free Python distribution (including for
commercial use and redistribution). It includes more than 300 of the
most popular Python packages for science, math, engineering, and data
analysis.
One great feature of Anaconda is that it installs to your home folder, to which you should have write access.
It ships with a conda script that let's you install packages too.
Keep in mind that you will not be able to add it to the System PATH, though you can try to add it to your user PATH. If you can not add it to either, you will have to manually specify the full path to the python executable to run scripts from the command line.
I would suggest you try using Anaconda. It can be installed to a local user folder without requiring admin permissions.
With this, you also get a quite nice package management conda.
Uncheck 'Install for all user' when the installation starts. Rest will be taken care by Python-3.
I'm using Python-3.7.6 with this method.
This installation method will automatically updates current user's path for Python. But the application name will be py instead of python. The user has to handle environment variables if he wants to use pip or python commands.
As mentioned earlier here, use Anaconda. The default installation process does not require Windows Admin privileges. It comes with nice package management (that might not work if you are sitting behind corporate firewalls).
With Windows 2010 edition May 2019, you won't have to execute a msi setup or download an Anaconda edition or go to the python website.
Windows has a python.exe and python3.exe already pre-installed
those commands will get you directly to the Microsoft Store!
Example: Python 3.9, which installs python and puts python on the path for the current user. So, no need for admin privileges.
There is a discussion about this on the Talk Python To ME podcast #191 with Steve Dower from Dec. 2018.
See more at "Who put Python in the Windows 10 May 2019 Update?" from the same Steve Dower (also on Stack Overflow):
This version of Python is fully maintained by the community, installs easily on Windows 10, and automatically makes common commands such as python, pip and idle available (as well as equivalents with version numbers python3 and python3.7, for all the commands, just like on Linux).

I installed Python 3.4.3 over 3.4.2 on Windows 7... and now I cannot uninstall Python

I installed Python 3.4.3 over 3.4.2 on Windows 7 and got problems with IDLE not starting.
When I use the Windows uninstaller via the control panel I get the message:
"There is a problem with this Windows Installer package a program required for this install to complete could not be run. Contact your support personnel or package vendor."
If I try to remove Python via the msi file then I get the same message.
There is no Python34 directory on my machine. I noticed that there is an entry in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\Modules. I didn't want to mess with my registry, but can I safely delete this entry? Is there any more to delete?
I used MicrosoftFixit.ProgramInstallUninstall and I was able to remove Python34 and then it reinstalled without any problems.
Had a similar problem. This is what I did:
Restart computer (kill any running processes of Python)
Delete the main Python folder under C drive.
Using CCleaner (or a similar application), use the Tools -> Uninstall feature to remove Python (if it is still there after deleting the folder)
Then go to the Registry window in CCleaner and clean the registry. Python should now be completely gone from your computer.

Installing modules in Python without command line

Hi I am going interstate and will only have my laptop with me, I do not have admin rights on it and the use of Cmd is banned. I want to be able to use Pygame on my laptop. How can I install the module without command line?
If you have a C compiler, you can download the source from http://www.pygame.org/download.shtml.
If you feel comfortable with Linux, you could use a live USB drive to boot into Linux and work there (without installing anything to the actual hard drive), or you could set up a new OS inside of a virtual machine. Good luck.

How to install/run Python on a Mac

After giving up on doing a disk partition and getting Linux, I decided to try and install Python 3.3.2 on a 32 bit Intel Core 2 Duo iMac with OS X 10.6.8 Snow Leopard. I did pretty much everything the official website says, but it isn't working at all.
First of all, I downloaded the installer for Mac OS X 6 and later, which should supposedly put a folder called MacPython 3.3 with IDLE, PythonLauncher and a Build Applet tool in my Applications folder. What I have instead is a folder called Python 3.3 which does contain (aside from the documentation and a command to update shell profile) IDLE and PythonLauncher, but no Build Applet tool; I typed 'python' into my Terminal window to see if 3.3.2 was installed, but it said Python 2.6.1 even after restarting my computer. The ReadMe in the disk image that contains the installer says running the installer should also 'put the underlying machinery into the folder /Library/Frameworks/Python.framework'. I did every search imaginable and apparently there is no such folder anywhere in my hard drive.
Basically, I want to install 3.3.2 and run things in programme mode rather than shell mode, which I find to be a huge pain in the bottom. Any help is greatly appreciated.
You don't need to download or install any software.
Just write your code in your preferred text editor, and save it as a anything with .py at the end. Next, go to a terminal and type in python *****.py, where ***** means whatever your file is named.
Try typing 'idle python3.3' or something similar in the terminal.

Py2app issue: python binary does not have a shared library (or framework) at all

I am trying to build a distribution for a script. I have used py2exe to create an exe file and it works fine. I am trying to use py2app to create something similar for Mac.
However, I am getting this error when I use the command
python setup.py py2app
Error Message: python binary does not have a shared library (or framework) at all
Any idea why this is the case?
I am importing some modules like BeautifulSoup apart from the standard ones like urllib, math in the main script file
I am running the entire thing on a 64-bit Windows machine running python 2.7
You need to run py2app on a Mac.
The py2app code uses the copy of Python that's being used to run it to build the standalone executable. If that Python isn't a Mac build (which it won't be, if you're running on Windows), it won't be able to create a Mac executable.
Technically, the error message is telling you that it can't find the libpython.dylib or Python.framework associated with sys.executable, which is true, but could be more useful in this case.
There are alternatives to py2app, like cx_freeze, but they all work the same way: building an executable out of the Python installation used to run them.
So, if you want to build a Mac executable on Windows, there's no automated way to do it.
But there are a few possibilities.
First, you can buy a used Mac Mini for probably $100 or so. Get it set up for development, turn on Remote Login access (in the Sharing pane of Preferences) and leave it running in the corner. From Windows, you can use a little 4-liner ssh script to tell the Mac to check out the source, py2app it, zip up the result, and scp it over to the Windows box (or copy it via Windows file sharing, or ftp it, or check it into source control, or whatever).
If that's not feasible for some reason, hopefully you can at least get access to a Mac once in a while. (If not, how are you ever going to test things?). If so, you can build an app with py2app and zip it up to use as a template. Each time you want to make a new build, you can do that on Windows, just by modifying what's in the template.
The main foo.py script goes in foo.app/Contents/Resources/foo.py. Any other Python modules (whether standard-library, third-party, or your own code), with a few exceptions, go into the fake-standard-library zipfile in foo.app/Contents/Resources/lib. Any C extension modules go into a directory like foo.app/Contents/Resources/lib/python2.7/lib-dynload.
As long as you don't modify any C extensions, upgrade to a new version of Python, or add new third-party libraries that you don't know how to install manually (e.g., because you got them as an egg via easy_install), this will continue to work. If you do any of those things, you'll need to go back to the Mac and create a new template with py2app.
If you don't have access to a Mac at all, you may be able to find a pre-built py2app-generated app for some other project that happens to contain everything you need, in which case you can use it as a template. But this is a huge stretch.

Categories

Resources