Unable to use tmuxp - python

I installed tmuxp using sudo pip install --user tmuxp. However I'm unable to load my profile work.yaml.
It throws error
Traceback (most recent call last):
File "/home/pranav/.local/bin/tmuxp", line 7, in <module>
from tmuxp import cli
ImportError: No module named tmuxp
I've followed https://github.com/tony/tmuxp instructions.

Uninstall: pip uninstall tmuxp
Assure the binary file is removed: rm ~/.local/bin/tmuxp
Reinstall: pip install --user tmuxp
Double check your python / pip configuration:
If the above doesn't work, there may be a larger issue with your pip installation, the problem may be a generic pip issue. 90% of the time this happens with PATHs from system's python mix up your user-level python.
Check which pip, which python and get an eye through tracebacks if your system's packages are mixing up with your local ones (e.g. /usr/local/python3.7/site-packages and ~/.somepath/python3.7/site-packages. If that is the case, consider clearing out all local pip packages and reinstalling pip through the get-pip.py installer.

Related

Prioritize conda pip over pip

I installed pip and installed python for terminal use for a previous course. The course I am currently in, specified I install Anaconda. I installed Anaconda and when using JupyterLab for python and plotly, I installed the plotly-geo package. It says it is not installed though and when I try to install again it says it is installed.
Is it because I installed pip python prior? How would I remove all of pip and reinstall it for Anaconda?
Traceback (most recent call last):
File "./Desktop/Data_Visualization/p3_source/p3.py", line 25, in <module>
exponent_format=True,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/plotly/figure_factory/_county_choropleth.py", line 622, in create_choropleth
"""
ValueError:
The create_choropleth figure factory requires the plotly-geo package.
Install using pip with:
$ pip install plotly-geo
Or, install using conda with
$ conda install -c plotly plotly-geo
The path of the site packages from your error suggests that you are executing your script with the non-anaconda version of python. I would suggest to uninstall it and only keep your anaconda distribution, as you can just create virtual environments should you need another python version

Why is my pip braking after updating

My pip broke after I ran
pip install --upgrade pip
When I run this command
pip -V
or any other commands I get
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
Why is it breaking? I have python3 installed. I have a solution but I need to understand why it broke after upgrading to the latest version.
pip authors were warning for many years to not import pip. Finally at version 10 they restructured their code.
Your /usr/bin/pip was not upgraded (probably because pip install -U pip installed new /usr/local/bin/pip) so it uses the old API before renaming.
If that's the case I recommend to put /usr/local/bin before /usr/bin in $PATH.

Some issues with pip installation

I tried to install pip manager using the file get-pip.py as mentioned in the documentation- https://pip.pypa.io/en/stable/installing/
So, I downloaded the file and ran python get-pip.py and as a result, I had permission issues. So I again ran sudo python get-pip.py and it worked.
Now I wanted to install numpy. So I ran pip install numpy and it showed me the Import Error saying-
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
ImportError: No module named pip
But again when I ran sudo pip install numpy, it worked and got installed. Now, for every python script involving these pip packages, I have to run the script using sudo which I don't like. So how can I resolve these permission issues?
Just to mention-
python v2.7.12
pip v9.0.1
pip installation location- /usr/local/lib/python2.7/dist-packages

Installing Basic Python Modules

I first downloaded Python 3.3 with the purpose of then adding xlrd and xlwt to use with excel. I have been unable to install easy_install, distribute, or either of the above.
This is an error message I get after downloading distribute, extracting it and running distribute_setup.py from IDLE:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Extracting in c:\users\t\appdata\local\temp\tmpecnfj9
Now working in c:\users\t\appdata\local\temp\tmpecnfj9\distribute-0.6.49
Installing Distribute
Something went wrong during the installation.
See the error message above.
Traceback (most recent call last):
File "C:\Python33\Lib\site-packages\distribute-0.6.49\distribute_setup.py", line 556, in <module>
sys.exit(main())
SystemExit: 2
Overall, I am unable to install and use any modules. I assume I am missing a very basic step.
In Python 3.3, setuptools replaces distribute. Download and install setuptools and you should be good to go. You might also want to consider installing pip after installing setuptools. Follow the directions for setuptools and pip in pypi.
Install Python in a drive where you have downloaded the Python Source which is in .msi format or you can change the drive of that source file and then try to install it. Just a simple installation process, nothing typical.
No worries. Make sure you have done the following
Ensure that you have python and pip installed and accessible from the command line. Type both of these commands to ensure that you have python and pip3 installed:
a. pip3
b. python3
If you got any message telling you that you do not have them installed on your system
Use the pip3 install PACKAGE_NAME_HERE command in your terminal/cmd to install modules/packages
If you get the pip3 command not found error, then type the respective command
a)If you are on a mac device, install brew: brew install python3. Then install pip3: brew postinstall python3. Then call pip3 -V to see if it works.
b) If you are on a Linux device, use, sudo apt install python3-pip to install pip

How to use pip with new Python version?

I have python2.6 as my default python and I've been using distribute easy_install to install packages in ~/.local. easy_install has many issues and I'd like to switch to pip, while at the same time upgrading to python2.7 from python2.6. My existing pip version is tied to python2.6 and always looks in ~/.local/lib/python2.6 for packages. This means I have to install pip again with Python2.7 but it seems like this cannot be done with the existing python2.6 pip, right?
Therefore I tried to download pip and install it like this:
python2.7 setup.py install --prefix=~/.local
Note that I do not have root, so I have to install pip locally. When I try this I get:
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup
ImportError: No module named setuptools
How can I fix this situation? I obviously cannot install setuptools with pip, because I can't install pip... all I want to do is link up pip with python2.7, upgrade pip and then install everything with pip and forget about easy_install and the old python2.6 and its packages.
When I try the answer below, I get:
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/home/user/.local/lib/python2.7/site-packages
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
I had to manually create (with mkdir) the directory:
~/.local/lib/python2.7/site-packages
This seems broken... it worked once I did it, but why does it require manual creation of a directory?
thanks.
You need to install setuptools first; it has it's own installation script (it's part of the egg file):
wget "http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg"
sh setuptools-0.6c11-py2.7.egg --prefix=~/.local
Note that it, too, supports a --prefix= option. It'll find your python2.7 binary (and not the 2.6 version) because you downloaded the 2.7 egg version.

Categories

Resources