I would like to install older versions of python for use with virtual environments, ideally from source as these versions are readily available on the official python website python 3.6 here however I can't seem to find any decent instructions.
The link above has version 3.6 full link to the tar.gz here. It downloads, I move into to program files and unzip it with 7zip:
C:\Program Files\7-Zip\7z.exe e Python-3.6.9.tgz
Then unpack the tar file:
tar -xvzf Python-3.6.9
There is no python.exe file in the unpacked directory to add to my path?
Am I missing a build step perhaps?
I found some more instructions here - where there really should be good instructions!, git is installed and setup, as is vs-code. I ran :
PCBuild\build.bat
The file 'PCBuild\pcbuild.sln' appears to have been successfully produced. Now what? I run the test described here
rt.bat -q
And I get: The system cannot find the path specified
For some reason when I run build.bat, a lot of what is printed to the seems to be mentioning python 3.8 which is now the default install on my system, its as if this method is not even pointing to the right version of python.
Please note I am looking specifically for native python approaches to this - NOT conda approaches as it is incompatible with a number of things I am doing.
I've tried; another SO queation, another SO question, here, and here, also here.
Many install guides seem to show only how to install the latest version of python using the python installer, which doesn't seem to be able to be used for legacy versions of python.
Also pythons official site has a link at the bottom labelled ' tools for unpacking archive files' which one would presume would help you to unpack, possibly even install archive files, however the link just takes you back to the top of the page?
Any help would be much appreciated?
Related
this is my first question here;-)
I am using Python 3.6 via Anaconda Navigator (1.7) and that program shows a list of packages when I click Environments.
Are these packages directly useable or do I have to start any process therefor?
In a script I want to use the import-function for the package "gf", this one is not in the list above.
Where do I find it in a compatible form and how can I make it useable?
Anaconda says it has to be .yaml or .yml (Conda environment files) or .txt (Conda explicit specification files or pip requirement files)
I know the other way with the command line and WHL files, but Anaconda does not seem to have any command line as the kind-of-user-guide says.
First I tried renaming other install files to .txt, but Anaconda just took ages and got a serious problem that I had to restart it several times.
I also tried to check https://anaconda.org/conda-forge for "gf", but it seems not available there.
Best Regards
By GF, do you mean Grammatical Framework (https://www.grammaticalframework.org/)? If so, then you can't install it via Anaconda. Maybe you would be interested in one of the following options?
Jupyter kernel for GF
From https://github.com/kwarc/gf_kernel#readme:
gf_kernel is a Jupyter kernel for the Grammatical Framework (GF) . It allows you to write grammars and using them for parsing/translating/... all in one notebook, which makes it great for demos and teaching, but also for small experiments with GF.
You need to have GF installed: see https://www.grammaticalframework.org/download/index.html for options.
Using GF grammars from an external Python program
Python bindings to the PGF library are included in the GF binary, so if you have Mac or Ubuntu, the easiest way is to download the binary.
For other systems, see this blog post for how to install.
I am trying to install pypy3 in TI's ARM embedded system.
It was based on linux, so I thought I could install pypy3 like I can do in linux system, but it did not work that way.
Here is what I've done:
unzip the zip file to /opt
made symlink to /usr/local/bin by ln -s opt/pypy3/bin usr/local/bin
I have checked that contents of opt/pypy3/bin are in usr/local/bin.
In each directory, libpypy3-c.so, pypy3, libpypy3-c.so.debug, and pypy3.debug exists
Then when I try pypy main.py, it doesn't work.
It just says -sh: pypy: command not found
They are the ordinary steps of installing pypy in linux.
Is there anyone who has any idea to solve this problem?
Added
When I directly run pypy3 like ./../opt/pypy3/bin/pypy3 main.py, an error message pops up says:
./../opt/pypy3/bin/pypy3: error while loading shared libraries:
libbz2.so.1.0: cannot open shared object file: No such file or
directory
What processor does the TI use? The arm downloads are based on raspberry PI or equivalent. Try the hard float one from here http://www.pypy.org/download.html
It seems you need to add the location of the pypy binary to your $PATH
Read again the sentence here "Linux binaries are only usable on the distributions written next to them". You will need to figure out how to get those dependencies on your distribution, using your OS's package manager. If you work it out, please share your solution so others can reuse it.
I am trying to reinstall Python, so I go control panel > uninstall > Python 3.6.2. It succeeds, but when I try to download 3.6.*, it says that I can't download because there is already a version of Python3 installed.
I tried to clean the registry, deleted all files named "Python", but still see the error. I even deleted the path Python in PATH.
This may be a silly solution, but for me the issue was the Python Launcher still listed in the apps list after the uninstall. Uninstalled it separately, afterwards reinstalled Python without the error.
The installer/uninstaller does not do a good job of cleaning up after itself (and that's being generous). What worked for me:
Remove all python binary folders from Program Files and Users\<username>\AppData
Clean the PATH of any and all mentions of python
Search the registry in Computer\HKEY_CLASSES_ROOT\Installer\Features for any values with python, then delete the containing key. The key names are things like "03CEBFB8CC334B3148F9B330F67264A6" (that's an example, not an actual one, since the actuals I deleted)
#3 is the one that actually got it past the hurdle, but #1 and #2 should be done anyway.
My issue persisted despite all the above. If you're still having issues:
I realized the Python installer shows a log file link... wish I had noticed it sooner. Click to open that log, search for "Detected". Find all lines with "Detected related package". These lines are specifically what's tripping the installer. Notice the version numbers are higher than the version you're installing, along with the "Operation: Downgrade"s).
Once you find these GUIDs in your log, you'll need to search each of them in the registry. I use a free registry tool called Resplendence Registry Registrar Manager (I have no connection with them), which searches the registry blazingly fast and will show everywhere it finds something. But you can also just use Windows' native RegEdit, as well.
When you find one of these GUIDs in the registry, rename the key by adding an underscore to it, like below. This is the equivalent of "deleting" them -- as far as the Python installer can tell -- but without actually deleting them. You can easily revert them if needed.
Re-run the Python installer and it should now install just fine.
Delete all the files of the old version python and try to re-install to uninstall the older version you can do it from control panel
Install another version. For example, if you are installing a 64-bit installation, then try to install 32-bit.
Download zip file from below URL.
https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-amd64.zip
Copy all the contents to the python folder which is registered in the environment.
I managed to fix all this Python cringe by doing this:
Download newest version of Python for your version after the first point. In this case it's Python 3.6, so I downloaded the latest available - 3.6.8:
https://www.python.org/downloads/release/python-368/
Run it.
Check the checkbox "Add Python to Path":
Press on the Custom Installation button:
Press Next:
Install:
It should install. Now go to Control Panel\Programs\Programs and Features, press RMB and uninstall:
Now run your wanted Python 3.6.X installation again.
If it still gives you the "A newer version of the Python launcher is already installed", run the latest installer again as in all the previous steps, but instead, check the "Install for All Users" checkbox:
Then uninstall this latest version again.
And then install your wanted Python 3.6.X installation again.
I'm throwing hands in the air, personally
I had to do it just now for 3.6, 3.7, 3.8, 3.9 and 3.10 versions because I had problems with uninstalling and installing with errors "no python installation was detected" and "A newer version of the Python launcher is already installed". Why do I have all these different versions of Python? Because different programs want different versions of Python installed and refuse to work with any other(lmao).
World would be a better place without Python.
For me, the solution to the problem (a newer version of the python launcher is already installed) was to install it via the web installer from the website (https://www.python.org/downloads/windows/)
Download the Windows x86-64 web installer. The installer took for his series (3.7). Oddly enough, it worked the first time. Previously, the registry was cleaned, and the removal of possible traces of the program - all to no avail.
I am in the process of migrating from an old Win2K machine to a new and much more powerful Vista 64 bit PC. Most of the migration has gone fairly smoothly - but I did find that I needed to reinstall ALL of my Python related tools.
I've downloaded the mechanize-0.1.11.tar.gz file and ran easy_install to install it. This produced C:\Python25\Lib\site-packages\mechanize-0.1.11-py2.5.egg.
I then ran a python script to test it, and it worked fine under the interpreter. But, when I ran py2exe to compile the script, I get a message that mechanize cannot be found.
I then moved the egg to a new folder, used easy_install to install it - and got every indication that it did install.
But, I still get the same message when trying to use py2exe - that mechanize does not exist!
I did a search for "mechanize" of the entire disk, and get only the 2 egg files as a result. What files should be produced by the install - and where should I expect them to be located?
Obviously, I'm missing something here...any suggestions?
Also, perhaps related, the python I am running is the 32 bit 2.5.4 version...which is what I had before and wanted to get everything working properly prior to installing the 64 bit version - plus, I don't see some of the tools (easy_install & py2exe) which seem to support the 64 bit versions. Is that part of the problem, do I need to install & run the 64-bit version - and will that be a problem for those who run 32-bit PC's when they run my scripts?
There is a note on the py2exe site that it does not work if the source is in egg format:
py2exe does not currently (as of
0.6.5) work out of the box if some of your program's dependencies are in
.egg form.
If your program does not itself use
setuptools facilities (eg,
pkg_resources), then all you need to
do is make sure the dependencies are
installed on your system in unzipped
form, rather than in a zipped .egg.
One way to achieve this is to use the
--always-unzip option to easy_install.
Which version are you running? The latest version listed at pypi.python.org is version 0.6.9 but there is no indication I can find if the problem with eggs is fixed in this release.
As other users suggested as above... I hereby summarize the steps I need to make Mechanize and BeautifulSoup work with py2exe.
Converting .py Files to Windows .exe
Follow instructions in here: py2exe Tutorial
STEP 1
Download py2exe from here… http://sourceforge.net/projects/py2exe/files/
(I am using Python 2.7)
I installed 0.6.9 for Python 2.7
py2exe-0.6.9.win32-py2.7.exe (201KB)
Install it
STEP 2
Try a hello world file.. to make sure all works.. as given in
http://www.py2exe.org/index.cgi/Tutorial
Python setup.py install (step 2 on web tutorial)
Then use a setup.py (step 3 on web tutorial).
See Issues below for any problems with Modules (under this folder: C:\Python27\Lib\site-packages)
STEP 3
Test the executable file.. in the dist directory.
In summary, when you have problems with modules, make sure you visit the site packages directory.. and see if the full package is there instead of just the .egg file.
py2exe cannot make use of just the .egg file (a layman's understanding).
Issues:
Mechanize module was not found by py2exe.. this was due to my first installation of mechanize on my local machine was just an .egg file (mechanize-0.2.5-py2.7.egg.OLD 324KB).. I need to install the full mechanize like this:
easy_install --always-unzip <library_name>
I did that.. then this time mechanize was installed in a folder named mechanize-0.2.5-py2.7.egg (1.1MB).
Also beautifulsoup-3.2.0-py2.7.egg originally the .egg file was 69KB… and after installing with
easy_install -–always-unzip BeautifulSoup
it was installed in a folder named beautifulsoup-3.2.0-py2.7.egg (229KB).
Some instructions in here: http://www.daniweb.com/software-development/python/threads/204941
I'm trying to install python to a 1and1.com shared linux hosting account.
There is a nice guide at this address:
http://www.jacksinner.com/wordpress/?p=3
However I get stuck at step 6 which is: "make install". The error I get is as follows:
(uiserver):u58399657:~/bin/python > make install
Creating directory /~/bin/python/bin
/usr/bin/install: cannot create directory `/~’: Permission denied
Creating directory /~/bin/python/lib
/usr/bin/install: cannot create directory `/~’: Permission denied
make: *** [altbininstall] Error 1
I look forward to some suggestions.
UPDATE:
Here is an alternative version of the configure step to fix the above error, however this time I'm getting a different error:
(uiserver):u58399657:~ > cd Python-2.6.3
(uiserver):u58399657:~/Python-2.6.3 > ./configure -prefix=~/bin/python
configure: error: expected an absolute directory name for --prefix: ~/bin/python
(uiserver):u58399657:~/Python-2.6.3 >
The short version is, it looks like you've set the prefix to /~/bin/python instead of simply ~/bin/python. This is typically done with a --prefix=path argument to configure or some other similar script. Try fixing this and it should then work. I'd suggest actual commands, but it's been a while (hence my request to see what you've been typing.)
Because of the above mistake, it is trying to install to a subdirectory called ~ of the root directory (/), instead of your home directory (~).
EDIT: Looking at the linked tutorial, this step is incorrect:
./configure --prefix=/~/bin/python
It should instead read:
./configure --prefix=~/bin/python
Note, this is addressed in the very first comment to that post.
EDIT 2: It seems that whatever shell you are using isn't expanding the path properly. Try this instead:
./configure --prefix=$HOME/bin/python
Failing even that, run echo $HOME and substitute that for $HOME above. It should look something like --prefix=/home/mscharley/bin/python
You really should consider using the AS binary package from Activestate for this kind of thing. Download the .tar.gz file, unpack it, change to the python directory and run the install shell script. This installs a completely standalone version of python without touching any of the system stuff. You don't need root permissions and you don't need to mess around with make.
Of course, maybe you are a C/C++ developer, make is a familiar tool and you are experienced at building packages from source. But if any of those is not true then it is worth your while to try out the Activestate AS binary package.
I was facing same issue with 1and1 shared hosting (Your provided linked tutorial is not available now). I followed Installing Python modules on Hostgator shared hosting using VirtualEnv tutorial with only one change for 1and1. That is:
Instead of:
> python virtualenv-1.11.6/virtualenv.py /home1/yourusername/public_html/yourdomain.com/env --no-site-package
I used:
> python virtualenv-1.11.6/virtualenv.py /kunden/homepages/29/yourusername/htdocs/env --no-site-package
Rest of the instructions worked and I successfully installed VirtualEnv.
Example: 1and1 does not provide Requests module and pip cannot be used in shared hosting. This screenshot demonstrates that after installing VirtualEnv, pip command can be used and at the end >>> import requests successfully worked.