Offline centos install psutil - python

I am working on CentOS machine which cannot connect to internet, for some reasons I need to install a python module psutil, so I got psutil-2.1.3 package but not there is no clear instruction how manually one can install it in centOS system

This is usually pretty simple:
Got to PyPi
Download the .whl file for your Python version and copy it to your server
Run pip install path/to/wheel.whl, depending on your seetings you might need to install this with sudo or from a virtual environment
???
Profit!

Related

Installing dependencies for a python code in windows 10?

There is a python script that I want to run on windows 10 but it requires these dependencies:
apt-get install python-dmidecode libcdio-utils acpidump mesa-utils
But windows does not support the "apt-get" command.
I have tried chocolatey but I couldn't find those libraries that I am trying to download.
Anyone have any ideas on how I could make that script work?
You can use "pip"(version 2 or 3) or "easy_install"(version 2 or 3) in :
C:\"Your Python version"\Scripts>
or
C:\Users\<your username>\AppData\Local\Programs\Python\"Your Pythonn Version"\Scripts>
apt-get is package distribution manager for Ubuntu and a few other linux distributions. It only handles linux packages, so there is no point trying to get it running on Windows 10.
For handling / managing Python packages and dependencies, you can try using Conda. You can install it by downloading either Anaconda or Miniconda. After installation, to get a new package use either
conda install <packagename>
or
pip install <packagename>
as Anaconda/Miniconda installs pip as well.

Not able to install Python3 on AIX server

I am trying to install Python 3 on a AIX server.
I got the Python 3 RPM file for AIX from here.
There were few dependencies that needed to be installed before installing Python, but I chose to install it without having installed any dependency through nodeps.
Now when I execute a Python3 command, I get the following errors:
It says cannot load module /opt/freeware/lib64/libpython3.5m.so but the file does exists in that directory.
Both LIBPATH & LD_LIBRARY_PATH are set to lib64.
Edit: Adding the output of lslpp -L rmp.rte command
The issue has been resolved now :)
I downloaded and installed below 2 dependencies
libgcc
gettext
I need not had to downgrade RPM or install and use yum to download required dependencies.
Download 3.0.5.51 from here
After download execute the following command on the server as root:
# installp -acFXYd rpm.rte.3.0.5.51 all
This command should downgrade your RPM to 3.0.5.51 and make it usable.

Python 2.7.11 pip not installed

I have Python 2.7.11 installed on my machine which to my understanding should come with pip, however when I check the C:\Python27\Tools\Scripts\ directory there is no pip.exe present.
I have tried completely removing and reinstalling Python 2.7.11 without success. Running the installer pip is set to be installed, but after the install pip is nowhere to be found.
I also have Python 3.4 installed which has pip as expected. Any thoughts?
I encountered the same problem - pip not installed - with python-2.7.16, Win10, installing for 'all users'. It was resolved when I allowed the MSI installer to target the default location (C:\Python27) rather than changing it to under Program Files (x86). I've no clue why this changed anything.
python2.7.11 should install pip into c:\python27\scripts, you can take a look here
I used https://pip.pypa.io/en/stable/installing/ to make it install. Odd that an outside body has to make a tool to get pip to install. There is no mention of pip.pypa.io on the Python web site.
Although I got error messages, it did install, so check carefully.
You also may see a message suggesting that you upgrade to pip 9.0 with the command 'pip install --upgrade.' I highly recommend that.
Also, make sure you are in the directory where pip.exe is located when you run the commands. They don't tell you that, because they assume you know that, but we're not all geeks.
For people who are running into this issue, I have a Windows 10 x86 dev box that I use for exploit development, Python 2.7 was installed due to Immunity Debugger, this install did not include the new SSL package and did not include "pip".
There was no "C:\Python27\Scripts" folder which included pip. I did have a "C:\Python27\Tools\Scripts" folder which did not have pip installed.
I tired to install pip as suggested but did not work. Best way is to uninstall Python and install newest version, currently mine is 2.7.15 which came with pip as an option. This is what solved my issue, any older version of Python will need upgraded to support the SSL packages. You will receive the same errors when you try to install pip on an older version.
If you have reinstalled Python which included the SSL package and it still does not have pip, trying installing pip this way:
1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
2. python get-pip.py
https://pip.pypa.io/en/stable/installing/
This should work if you have a newer version of Python.
Once you have installed pip or newer version of python, go to "C:\Python27\Scripts" and you should see pip.exe.
I have installed "python-2.7.16" in my windows 10 PC. PIP is installed under "C:\Python27\Scripts". One can add the "C:\Python27\Scripts" path to environment variable and then access pip command from command prompt.
To add the path in environment variable:
Control Panel\System and Security\System --> Advanced System Settings --> Advanced --> enviroment variables --> under system variable --> Path(variable name)
Had the issue where no matter which version of python 2.7 I installed on windows 10 there was no pip.exe generated in the "Scripts" folder.
I solved it by ensuring that that MSI Installer file had Admin privileges before installing
if pip is not installed you can use easy_install.exe to install pip and other modules
you can find easy install in
python -m easy_install pip
I had the same issue:
Installed Python 27
Tried to use pip, but failed with unrecognized command error
Checked installation: no "C:\Python27\Scripts", only "C:\Python27\Tools\Scripts"
This issue happens only on some versions of Windows.
HOW TO FIX IT:
Uninstall Python 27
Reinstall Python 27, but unselect "pip" feature
Check installation: no "C:\Python27\Scripts" as expected
Start the installer again and use "Change Python"
Set "pip" and "Add Python.exe to Path" features to be installed
Check installation: "C:\Python27\Scripts" is now correctly present
So for some unknown reason, pip is not correctly installed on some versions of Windows if it is installed during default Python 27 setup. To fix this issue, pip must be installed afterwards using the "Change Python" setup.
I meet the same issue when install Python 2.7.9. The installer does not come with pip.
Solution:
Install newer python2 x86 version: https://www.python.org/downloads/release/python-2718/
Then pip is located at C:\Python27\Scripts\pip.exe
It happens on windows as you should have admin rights to install anything on disk C.
I have the same issue Scripts folder was not installed. I would sugest to instal it on disk D.

Installing Scrapy on Python VirtualEnv

Here's my problem,
I have a shared hosting (GoDaddy Linux Hosting package) account and I'd like to create .py file to do some scraping for me. To do this I need the scrapy module (scrapy.org). Because of the shared account I can't install new modules so I installed VirtualEnv and created a new virtual env. that has pip, wheel, etc. preinstalled.
Running pip install scrapydoes NOT complete successfully because scrapy has lot of dependencies like libxml2 and it also needs python-dev tools. If I had access to 'sudo apt-get ...' this would be easy but I dont'. I can only use pip and easy_install.
So How do I install the python dev tool? And how do I install the dependencies? Is this even possible?
Cheers
You can install all the dependencies by activating the python virtual environment first.
Step 1 :
On Linux :
env/bin/activate
On Windows :
env\Scripts\activate
Step 2:
pip install lxml
I just tried and it worked for me. Please find screen shot attached.
It's not possible to do what I wanted to do on the GoDaddy plan I had.
I had some of the same issues. I found this and modified to pip3.7 install lxml==3.4.2. I was able to install successfully.

Download python package with dependencies without installing

I need to download a python package with all its dependencies without installing, sneaker-net it to a computer without connection to the internet, and install it there. For example, I want to install buildbot, lettuce, etc.
The computer is a Windows 7 machine, using Python 2.7.
If the package has native extensions, I can build them on the computer.
You can use pip, with the --download option, which will download the main package and its dependancies, without installing them.
pip install --download="/path/to/downloaded/files" sneaker-net
And use these files one the local machine with:
pip install --no-index --find-links=<DIR on local machine> sneaker-net
See pip documentation --download for fast & local installs. You can use pip on Windows with cygwin for example.

Categories