- how to install python 3.x version in /usr/bin/?
- 4 Answers 4
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- How do I install a python package to /usr/local/bin?
- How to install python on macos into /usr/bin folder?
- Python.org Mac Installer
- Symlink Workaround Attempt
- How to download and use python on ubuntu? [closed]
- 4 Answers 4
how to install python 3.x version in /usr/bin/?
Then, python installed in /usr/local/bin but I want to install python in /usr/bin . How can I do that?
No, I haven’t. Although using pyenv can be an one way, I want to install python in /usr/bin directly.
4 Answers 4
There should be an option ‘—prefix’ so that
> ./configure --prefix=/usr > make > sudo make install
should do the job. Otherwise, search for ‘usr/local/bin’ in the configuration script and replace accordingly.
the prefix must be /usr otherwise it will create a new /lib inside the bin folder! Edit your answer please!
After doing this, packages that depend on python like apt-listchanges fail with errors like ImportError: No module named apt_pkg . any idea how to get the new installation to recognize those modules, or be compiled with those modules?
You can change the location using the —prefix option in configure (which defaults to usr/local ). Python will be installed under /bin, so if you want it in /usr/bin , you can write:
./configure --prefix=/usr --enable-optimizations make make install
While this code may resolve the OP’s issue, it is best to include an explanation as to how your code addresses the OP’s issue. In this way, future visitors can learn from your post, and apply it to their own code. SO is not a coding service, but a resource for knowledge. Also, high quality, complete answers are more likely to be upvoted. These features, along with the requirement that all posts are self-contained, are some of the strengths of SO as a platform, that differentiates it from forums. You can edit to add additional info, or links to documentation.
This following commands worked for me :
./configure --prefix=/usr make make install
Building Python with optimizations can take some time. If this has already been done and you wish to avoid repeating it, you might consider the following:
sudo make install prefix=/usr
I don’t know whether going rerunning ./configure will force a rebuild.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.27.43548
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
How do I install a python package to /usr/local/bin?
I am trying to install a python package on my ubuntu.I am trying to install it through a setup script which i had written.The setup.py script looks like this:
from setuptools import setup try: from setuptools import setup except ImportError: from distutils.core import setup setup( name = 'pyduino', description = 'PyDuino project aims to make python interactive with hardware particularly arduino.', url = '###', keywords = 'python arduino', author = '###', author_email = '###', version = '0.0.0', license = 'GNU', packages = ['pyduino'], install_requires = ['pyserial'], classifiers = [ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], scripts=['pyduino/pyduino.py'], )
Package installs in /usr/local/bin directory.But when I am importing the modules outside the /usr/local/bin,import error occurs.I tried changing path to /usr/local/bin and it works perfectly and import error doesn’t occur.How can I install the package so that I can import the modules in any directory? Thanks in advance.
How to install python on macos into /usr/bin folder?
I need a specific version of python to fit into the /usr/bin directory on my Mac to satisfy a bunch of tools that internally assume that location. These tools normally run on linux. I’m trying to create an environment on my Mac to develop on for tools that don’t need to run on linux. The linux environments are setup using the command
$ sudo apt-get install --assume-yes --no-install-recommends python3.6-dev
$ ls -la /usr/bin | grep python3.6 lrwxrwxrwx 1 root root 23 Dec 24 2018 pdb3.6 -> ../lib/python3.6/pdb.py -rwxr-xr-x 2 root root 4555968 Dec 24 2018 python3.6 lrwxrwxrwx 1 root root 33 Dec 24 2018 python3.6-config -> x86_64-linux-gnu-python3.6-config -rwxr-xr-x 2 root root 4555968 Dec 24 2018 python3.6m lrwxrwxrwx 1 root root 34 Dec 24 2018 python3.6m-config -> x86_64-linux-gnu-python3.6m-config lrwxrwxrwx 1 root root 34 Dec 24 2018 x86_64-linux-gnu-python3.6-config -> x86_64-linux-gnu-python3.6m-config -rwxr-xr-x 1 root root 3204 Dec 24 2018 x86_64-linux-gnu-python3.6m-config
Python.org Mac Installer
$ tree -L 1 /Applications/Python\ 3.6/ /Applications/Python\ 3.6/ ├── IDLE.app ├── Icon\r ├── Install\ Certificates.command ├── License.rtf ├── Python\ Documentation.html -> /Library/Frameworks/Python.framework/Versions/3.6/Resources/English.lproj/Documentation/index.html ├── Python\ Launcher.app ├── ReadMe.rtf └── Update\ Shell\ Profile.command
$ which python3.6 /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
There’s a bit of commentary discussing the specific flavor of mac and python installs at the official documentation https://docs.python.org/3/using/mac.html#getting-and-installing-macpython but it doesn’t clue me into how I can install into something other than Applications.
Symlink Workaround Attempt
I tried a workaround to create a symbolic link in my /usr/bin folder with sudo but I just get an Operation not permitted , which is apparently out of bounds by Apple’s System Integrity Protection.
$ sudo ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /usr/bin/python3.6 ln: /usr/bin/python3.6: Operation not permitted
How to download and use python on ubuntu? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
I recently purchased a system 76 laptop, this is my first exposure to the ubuntu os. Terminal says that I currently have version 2.7.5+(im not sure what the plus means). My first question is how do I actually use python on this computer since it does not come with idle and my second question is how do I download the newest version 3.3.4 which can be found here: http://python.org/download/releases/3.3.4/ ?
4 Answers 4
To begin, open a console window.
To install Python 3:
sudo apt-get update sudo apt-get -y install python3.3
To install IDLE:
sudo apt-get install idle3
Keep in mind that you can also open a terminal window and simply type python to be thrown into a python console. Python 3 may need to be forced with python3 if apt as decided not to overwrite your system’s default 2.7.5 install.
There are also other environments similar to IDLE that can be a lot nicer to use. One such example is a plugin for the Sublime Text text editor called SublimeREPL (A REPL is a Read Evaluate Print Loop — essentially the interactive python prompt). These REPLs are available for many interpreted languages and can be very handy to have close by when you’re writing code.
Here’s what it looks like on my OSX install: