How to install current OpenPYXL package on Ubuntu - python

I have some spreadsheet reading code (using openpyxl) that works correctly on my Windows installation. On my Ubuntu Rackspace server, however, it fails with a named range error.
I notice that the openpyxl package on Ubuntu (which I installed last week using apt-get) is several years old (1.5.6). I'd like to install the newest version (1.6.2).
What tool can I use to install the newer version, or is it something I need to do manually?

The Python packages available in the Ubuntu repositories generally don't get updated within an Ubuntu version, only when you upgrade to a newer Ubuntu release.
When you need newer versions of a Python package, you can use pip to get the newest version from the Python Package Index:
sudo pip install openpyxl

Stuck on the same problem, this is what I did to fix it.
On linux machines you need to install via apt package manager:
sudo apt-get install python-openpyxl python3-openpyxl

Related

Unable to install pandas or other packages in linux virtual environment

I am unable to install module pandas in my linux vm. I tried all ways to install it, but it says it has version 1.1.5 requirement already satistied. But when I try running the code, it says, no module found. The latest version of python in it is 2.7.3, but I want to install 3.8 or 3.7, but I'm unable to. Where am I going wrong?
Did you try installing python3 from your package manager? You can install python 3.9 from apt using the below command
apt install python3 pip -y
You can also install the below package to use python in the terminal instead of python3 every time
apt install python-is-python3 -y
I cant comment yet so using the answer section, kindly give me an upvote so I can start using the comment feature, sorry for the trouble

How can I check if pip can find python dev headers?

I'm trying to install Mujoco on a Ubuntu server and have a problem which very much looks like this: https://github.com/openai/mujoco-py/issues/265
The solution in that issue thread is to install the devel version of python3. Apparently that brings in python.h which is needed by Mujoco.
But things are complicated: I don't have root access on the machine. Pip comes from a conda environment and even on conda-forge, I don't see any dev version of python (Equivalent of apt-get install python3.6-dev for conda)
The installation guide for the server installs some packages with linuxbrew. There is a python package on brew and apparently it automatically ships with the python devel version: how to install python-devel in Mac OS?
Now I have anaconda python and brew python. How can I see which paths are picked up by pip and verify if it sees the python dev headers ?

Install confluent-kafka avro with pip

I'm trying to install the avro package for confluent-kafka with python3 on macOs Sierra.
Installing the confluent-kafka package works fine, no issues. The problem is when I try to install the avro package:
pip install confluent-kafka[avro]
I just get an error message from the bash, saying:
no matches found: confluent-kafka[avro]
How can I install this package? Anyone else that have managed to do it on mac?
Assuming you are not using bash (in my case it was zsh), the [] might mess with your shell. The following should solve this:
pip install "confluent-kafka[avro]"
For me this worked with the default install from pypi, no need for the github URL.
Try installing directly from github
pip install git+git://github.com/confluentinc/confluent-kafka-python.git
Solved! In my case it was python version
I was using python 3.10.1 version
Uninstall python 3.10.1 and python Launcher from add or remove programs
Download python 3.7.0 for x64 bit using this link or download from here Link
Now you can: pip install confluent-kafka[avro]

Download and install scapy for windows for python 3.5?

I installed python 3.5 for my windows 8.1 computer. I need to install scapy for this version (I deleted all the files of the last one). How do i download and install it? can't find anything that help me to do that no matter how i searched.
use
pip3 install scapy-python3
and you will get it
Scapy supports Python 3.3 to 3.6 (and 2.7) but, so far, no release has been made. For now, you have to get the current development version from https://github.com/secdev/scapy and install it.
Update: you can now install a 2.4.0 release candidate using pip3 install --pre scapy (--pre means you accept non-stable release).
Update: Scapy 2.4.0 has been released. You can now use pip3 install scapy!
Use pip from the command line:
pip install scrapy
Apologies, realised that according to the docs scrapy is not supported on Windows with Python 3.x due to missing dependency (Twisted)
Source: http://doc.scrapy.org/en/latest/intro/install.html

Python package installation via yum

What could be the difference of installing python packages via yum vs. via pipon Centos in terms of security? Is it even possible to install a python package only via yum?
yum can be used to install Python on CentOS.
pip is used to install Python libraries (packages). Not Python itself.
No "security" issue. But with yum you could overwrite your native Python installation, which can be a problem.
Instead of that, it is recommended to use virtualenv.

Categories