No-site-packages error when installing Hue with Ubuntu 13.10 - python

I got no-site-packages error while trying to install hue on my local system. Is there anyone who knows how to solve such an issue?
This is the commands I ran:
$ git clone git#github.com:cloudera/hue.git
$ sudo apt-get install (the ap list shows in https://github.com/cloudera/hue)
Enter Hue
$ make apps
I tried the solution which is provided in Google groups, but the same issue still keeps showing up:
$ sudo apt-get install python-pip
$ sudo pip install --upgrade virtualenv
$ cd /usr/lib/python2.7
$ sudo ln -s plat-x86_64-linux-gnu/_sysconfigdata_nd.py
Any help will be appreciated!

Weird, this seems to be the exact same problem as https://issues.cloudera.org/browse/HUE-1672.
Did you install setuptools 0.6?
pip installs python-setuptools (0.6.34-0ubuntu1)

Related

How do I delete pip and python

I've been having a lot of trouble with python and pip, I think both got corrupted or something. I'm new to all this. I'm using a Macbook pro running Monterey and I was curious how to delete python and pip so I can re-install them. Any ideas are greatly appreciated. I have it all installed in the terminal, no applications I think.
If you installed the earlier version of Python, you can take this method to uninstall it from your Mac. First open the Terminal, and input the following command lines:
sudo rm -rf “/Applications/Python”
sudo rm -rf /Library/Frameworks/Python.framework
sudo rm -rf /usr/local/bin/python
In order to delete pip you can use the following command
sudo python -m pip uninstall pip
or
sudo apt-get --purge autoremove python3-pip
I hope that my answer will be useful.
Since you're using mac you can type into terminal the following command to get the path of python and pip:
Python:
python -c "import sys; print(sys.executable)"
Pip:
which pip
Just use rm -r followed by the path you got

python3.7 No module named pip

i had a problem with installing packages to new upgraded python to version 3.7
When i type:
python3.7 -m pip install pip -d
/usr/local/bin/python3.7: No module named pip
I make easy_install like this: sudo easy_install pip what solve previous problems, but now it create pip3.7 in a weird way. Whem i calling for pip3.8 version, this returns me a message:
pip3.7 -V
pip 19.2.3 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
Someone know what i am doing wrong? I tried many things to resolve it. Reinstall, purge, install with symbolic link from python2 etc.
There is a script which i used to install python3.7 (i had also a problem with zlib):
sudo cd /home
sudo wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
sudo tar xf Python-3.7.3.tar.xz
sudo cd ./Python-3.7.3/
sudo ./configure
sudo make
sudo make install
sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3 10
python3 --version
Where is a mistake?
Answer finally i find myself. There: https://linuxize.com/post/how-to-install-python-3-7-on-debian-9/
There with similar errors you can recompile it, even without removal (on secound machine i checked without removal) failed installation before.
If someone want to good upgrade with everywith working on debian 9. I recommend that script:
NOW_DIR=$(pwd)
apt update
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
mkdir ~/python_upgrade
cd ~/python_upgrade
curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar -xf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure --enable-optimizations
make -j $(nproc)
make altinstall
python3.7 --version
cd $NOW_DIR
rm -rf ~/python_upgrade
There are minor changes from that commands in tutorial. Run above file.sh as root.
It can take some times, on my virtual machine with 2 cores during another job it takes 40 minutes. I hope someone find there good answer, not totally green comments like 'apt install' which is first try action before looking to web.

Python can't find module when started with sudo

I've got a script that uses the Google Assistant Library and has to import some modules from there. I figured out this only works in a Python Virtual Environment, which is really strange. In the same folder I've got a script which uses the GPIO pins and has to use root. They interact with each other, so when I start the GPIO script, the Assistant script is also started. But for some reason the modules in there can't import when the script is started with root. Does anybody know something about this?
not 100% sure but have you tried:
sudo -E python myScriptName.py
As mentioned here
Normally you can active a virtual env and use the interpreter inside the env to run your script. But it is not necessary.
Suppose you have a virtual env under the path /path-to-env/env
the script you want to run example.py is under the path /path-to-script/example.py
you can already run this example.py like
sudo /path-to-env/env/bin/python /path-to-script/example.py
Try to install the module using sudo.
I had the same problem with the module 'reportlab' from python. I realized that I had installed pip (the installer manager for reportlab) without sudo command.
The problem is that the package (pip and reportlab) has been installed as user and not as root, so when you try to use sudo, it does not recognize the system path to reportlab because you never installed in the first place, only for the user!
I recommend install pip and module with sudo always:
For python 2:
$ sudo add-apt-repository universe
$ sudo apt update
$ sudo curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
$ sudo python2 get-pip.py
$ sudo pip install google-assistant-library
For python 3 (from Docs Google assistant library):
$ sudo apt-get update
$ sudo apt-get install python3-dev python3-venv
$ sudo python3 -m venv env
$ sudo env/bin/python -m pip install --upgrade pip setuptools
$ sudo source env/bin/activate
$ sudo python -m pip install --upgrade google-assistant-library
Hope this helps! Regards!
I ended up just installing the python package as sudo and it worked fine. For my case it was sudo pip3 install findpi and then executed as sudo findpi and worked.

How can I install Python's pip3 on my Mac?

I'm trying to install pip3, but I'm not having any luck. Also, I tried sudo install and it did not work. How could I install pip3 on my Mac?
sudo easy_install pip3
Password:
Searching for pip3
Reading https://pypi.python.org/simple/pip3/
Couldn't find index page for 'pip3' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for pip3
error: Could not find suitable distribution for Requirement.parse('pip3')
UPDATED - Homebrew version after 1.5
According to the official Homebrew page:
On 1st March 2018 the python formula will be upgraded to Python 3.x and a python#2 formula will be added for installing Python 2.7 (although this will be keg-only so neither python nor python2 will be added to the PATH by default without a manual brew link --force). We will maintain python2, python3 and python#3 aliases.
So to install Python 3, run the following command:
brew install python3
Then, the pip or pip3 is installed automatically, and you can install any package by pip install <package>.
The older version of Homebrew
Not only brew install python3 but also brew postinstall python3
So you must run:
brew install python3
brew postinstall python3
Note that you should check the console, as it might get you errors and in that case, the pip3 is not installed.
You could use Homebrew.
Then just run:
brew install python3
I solved the same problem with these commands:
curl -O https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
For me brew postinstall python3 didn't work. I found this solution on the GitHub Homebrew issues page:
$ brew rm python
$ rm -rf /usr/local/opt/python
$ brew cleanup
$ brew install python3
Python 3 was working successfully, but without pip3. I tried advice from Stack Overflow, Quora and others (numerous installs and uninstalls).
Python 3 was always fine, but without pip3. Finally I downloaded Python3 from:
https://www.python.org/downloads/
By simple mouse clicks and everything (Python 3 + pip3), it is working fine now.
To install or upgrade pip, download get-pip.py from the official site. Then run the following command:
sudo python get-pip.py
and it will install pip for your python version which runs the script.
Similar to Oksana but add python3
$ brew rm python
$ brew rm python3
$ rm -rf /usr/local/opt/python
$ rm -rf /usr/local/opt/python3
$ brew prune
$ brew install python3
$ brew postinstall python3
Seem now work for pip3 under mac os x 10.13.3 Xcode 9.2
I ran the below where <user>:<group> matched the other <user>:<group> for other files in the /usr/local/lib/python3.7/site-packages/ directory:
sudo chown -R <user>:<group> /usr/local/lib/python3.7/site-packages/pip*
brew postinstall python3
I also encountered the same problem but brew install python3 does not work properly to install pip3.
brre will throw the warning The post-install step did not complete successfully.
It has to do with homebrew does not have permission to /usr/local
Create the directory if not exist
sudo mkdir lib
sudo mkdir Frameworks
Give the permissions inside /usr/local to homebrew so it can access them:
sudo chown -R $(whoami) $(brew --prefix)/*
Now ostinstall python3
brew postinstall python3
This will give you a successful installation
After upgrading to macOS v10.15 (Catalina), and upgrading all my vEnv modules, pip3 stopped working (gave error: "TypeError: 'module' object is not callable").
I found question 58386953 which led to here and solution.
Exit from the vEnv (I started a fresh shell)
sudo python3 -m pip uninstall pip (this is necessary, but it did not fix problem, because it removed the base Python pip, but it didn't touch my vEnv pip)
sudo easy_install pip (reinstalling pip in base Python, not in vEnv)
cd to your vEnv/bin and type "source activate" to get into vEnv
rm pip pip3 pip3.6 (it seems to be the only way to get rid of the bogus pip's in vEnv)
Now pip is gone from vEnv, and we can use the one in the base Python (I wasn't able to successfully install pip into vEnv after deleting)
Installing Pip3
Follow this link to download pip3 on your computer
Follow the instructions on the page and then after successfully downloading Pip3, run python3 get-pip.py in your terminal
This will install pip3 into your laptop and then you can check the installation of pip3 by running which pip3 in your terminal.
Now simply do pip3 install <package>
If you're using Python 3, just execute python3 get-pip.py . It is just a simple command.

Install python-matplotlib under Ubuntu

I am having difficulty with the installation of python-matplotlib. When I followed the instructions here, and then try to type:
cd matplotlib-matplotlib-bb3ea55
I get the following error:
bash: cd: matplotlib-matplotlib-bb3ea55: No such file or directory
I would appreciate any help.
Use pip command.
sudo pip install matplotlib
If you don't have pip:
sudo apt-get install python-pip
-EDIT-
For python 3 change python-pip to python3-pip

Categories