Linux install python dev

stormwild / python-setup-dev.md

To use easy_install you need to install setuptools. setuptools is not maintained so then instead of it, distribute take the place of it. but now setup tool is updated. if you want to know more check official site

$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py 

Execute it and start install

After enabling easy_install, install pip next. What is pip? check document

Install virtualenv and virtualenvwrapper

Virtualenv enables you to make different environment with version python or combination of package. virtualenv

$ sudo pip install virtualenv virtualenvwrapper 

Setting for virtualenvrapper

$ vim ~/.bashrc ~/.bashrc if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh fi $ source ~/.bashrc 

Now you can make virtual python environment easily.

mkvirtualenv : make virtualenv 

In virtualenv, its name is at the head of prompt and you can use pip freely in it.

(work)webees@ubuntu:~$ pip install Django Freeze : confirm what packages are installed (work)webees@ubuntu:~$ pip freeze Django==1.6 argparse==1.2.1 wsgiref==0.1.2 Deactivate : get away from virtualenv (work)webees@ubuntu:~$ deactivate virtualenv with python3 Confirm the path to python3 $ which python3 /usr/bin/python3 Set path with -p option $ mkvirtualenv -p /usr/bin/python3 python3 (python3)webees@ubuntu:~$ python -V Python 3.2.3 Workon : switch virtualenv or confirm its exist. $ workon python3 work Rmvirtualenv : remove virtualenv $ rmvirtualenv work 

This article will help you to install Python 2.7.13 on your Ubuntu, Debian and LinuxMint operating systems. At writing time of this article Python 3.4.5 latest stable version is available to download and install. To install Python 3.4.5 visit following article.

How to Install Python 3.4.3 on Ubuntu & LinuxMint

Install Required Packages

Use the following command to install prerequisites for Python before installing it.

$ sudo apt-get update $ sudo apt-get install build-essential checkinstall $ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev 

Download Python using following command from python official site. You can also download latest version in place of specified below.

$ cd /usr/src $ wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz 

Now extract the downloaded package.

Читайте также:  Linux команда показать процессы

Use below set of commands to compile python source code on your system using altinstall.

$ cd Python-2.7.13 $ sudo ./configure $ sudo make altinstall 

make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

Step 4: Check the Python Version

Check the latest version installed of python using below command

Источник

How To Install python3.9-dev on Ubuntu 22.04

In this tutorial we learn how to install python3.9-dev on Ubuntu 22.04.

What is python3.9-dev

Header files, a static library and development tools for building Python (v3.9) modules, extending the Python interpreter or embedding Python (v3.9) in applications.

Maintainers of Python packages should read README.maintainers.

There are three ways to install python3.9-dev on Ubuntu 22.04. We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Install python3.9-dev Using apt-get

Update apt database with apt-get using the following command.

After updating apt database, We can install python3.9-dev using apt-get by running the following command:

sudo apt-get -y install python3.9-dev 

Install python3.9-dev Using apt

Update apt database with apt using the following command.

After updating apt database, We can install python3.9-dev using apt by running the following command:

sudo apt -y install python3.9-dev 

Install python3.9-dev Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

After updating apt database, We can install python3.9-dev using aptitude by running the following command:

sudo aptitude -y install python3.9-dev 

How To Uninstall python3.9-dev on Ubuntu 22.04

To uninstall only the python3.9-dev package we can use the following command:

sudo apt-get remove python3.9-dev 

Uninstall python3.9-dev And Its Dependencies

To uninstall python3.9-dev and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove python3.9-dev 

Remove python3.9-dev Configurations and Data

To remove python3.9-dev configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge python3.9-dev 

Remove python3.9-dev configuration, data, and all of its dependencies

We can use the following command to remove python3.9-dev configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3.9-dev 

References

Summary

In this tutorial we learn how to install python3.9-dev package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.

Читайте также:  Acronis образ linux системы

Источник

uogbuji / debian-pydev.md

User local install as much as possible, leaving system-wide kit (e.g. python & python-pip .debs) alone. Tested on Debian, Ubuntu, Mint & ChromeOS/Crostini.

Set up the dev environment (this is the only system-wide part):

sudo apt install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev liblzma-dev libreadline-dev libncursesw5-dev libffi-dev uuid-dev #Optionally: sudo apt install libxml2-dev libxslt1-dev git mercurial 
mkdir -p $HOME/.local/venv mkdir -p ~/src # mkdir -p ~/Downloads # If needed cd ~/Downloads wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tar.xz cd ~/src tar xvf ~/Downloads/Python-3.10* cd Python-3.10.4 ./configure --enable-optimizations --prefix=$HOME/.local make; make install 

Create & activate a virtual envirnment

export DEVENVTAG=main $HOME/.local/bin/python3 -m venv $HOME/.local/venv/$DEVENVTAG 

You only need to specify the full path to Python when creating the venv, as above.

source $HOME/.local/venv/$DEVENVTAG/bin/activate pip install wheel #Recommended; One time per venv pip install --upgrade pip #Needed from time to time, to make sure pip itself is up to date 

In future you only need the first line above to activate the venv.

Appendix: What’s the system Python on Debian, anyway?

First of all you can check whether the Debian version you want has the Python version you want. In April 2022 a query:

Indicated that the 3.10 version was only in testing and unstable, not in stable (when installed you got 3.10.4).

You can install Python 3 and other dev environment bits system-wide

sudo apt install python3 python3-dev python3-venv 

Though I still recommend sticking to .local and not mucking with system-level Python versions at all.

b'ls\r\r\n\r\nPassword: ' >>> uart1.read() >>> uart1.write(b'@@##$$%%\n');uart1.read() 9 >>> uart1.read() b'\r\n\r\nLogin incorrect\r\naml login: ' >>> uart1.write(b'root\n');uart1.read() 5 >>> uart1.read() b'root\r\nPassword: ' >>> uart1.write(b'@@##$$%%\n');uart1.read() 9 b'\r\nLogin timed out after 60 seconds.\r\n\r\r\nUbuntu 18.04.6 LTS aml ttyAML0\r\n\r\naml login: ' >>> uart1.write(b'killall htop\n');uart1.read() 13 b'@@##$$%%\r\r\nPassword: ' >>> uart1.write(b'@@##$$%%\n');uart1.read() 9 b'\r\n\r\nLogin incorrect\r\naml login: ' >>> uart1.write(b'root\n');uart1.read() 5 b'@@##$$%%\r\nPassword: ' >>> uart1.write(b'root\n');uart1.read() 5 b'\r\n\r\nLogin incorrect\r\naml login: ' >>> uart1.read() b'root\r\nPassword: \r\nLogin timed out after 60 seconds.\r\n\r\r\nUbuntu 18.04.6 LTS aml ttyAML0\r\n\r\naml login: ' >>> uart1.write(b'root\r\n');uart1.read() 6 >>> uart1.write(b'@@##$$%%\n');uart1.read() 9 b'root\r\r\n\r\nPassword: ' >>> uart1.read() b'\r\nLast login: Tue Sep 27 03:42:25 UTC 2022 from 192.168.1.3 on pts/0\r\n \x1b[0;1;34;94m____\x1b[0m \x1b[0;1;34;94m___\x1b[0m \x1b[0;1;34;9 4m___\x1b[0m \x1b[0;34m____\x1b[0m \r\n\x1b[0;1;34;94m/\x1b[0m \x1b[0;1;34;94m___|/\x1b[0m \x1b[0;34m_\x1b[0m \x1b[0;34m\\\x1b[0m \x1b[0;34m/\x1 b[0m \x1b[0;34m_\x1b[0m \x1b[0;34m\\|\x1b[0m \x1b[0;34m___|\x1b[0m \r\n\x1b[0;34m\\___\x1b[0m \x1b[0;34m\\\x1b[0m \x1b[@aml:~# ' >>> uart1.read() >>> uart1.write(b'killall htop\n');uart1.read() 13 >>> uart1.read() b'killall htop\r\nroot@aml:~# ' >>> uart1.read() >>> 

You can’t perform that action at this time.

Читайте также:  Grub for linux mint

Источник

How can I install python-dev off apt-get?

I have tried this and this and this and this None of those install python-dev, I got my amd64 system, 14.04 up and running, as I try to install wagtail, a django cms, I get the error:

 pysass.c:4:20: fatal error: Python.h: No such file or directory #include ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Cleaning up. Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/ libsass/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace ('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ojWg1O-record/install- record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/libsass Storing debug log for failure in /home/payload/.pip/pip.log 

How can I fix this and install the package? It’s because of the missing Python.h c header which is included in the python-dev package. When I tried the above links, it says: apt-get install python-dev

Package python-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: python E: Package 'python-dev' has no installation candidate 
Package python2.7-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python2.7-dev' has no installation candidate 

I have researched on the debian archives and found a package for python 2.7.8-1 but that couldn’t be installed. Tried this on launchpad too but doesn’t work.

Источник

Оцените статью
Adblock
detector