Fixing a failed upgrade to Jupyter complete uninstall/reinstall Ubuntu 14.04 - python

When I upgraded to Jupyter on Ubuntu 14.04 most everything works but the javascript loads for extensions..
I'm kind of giving up and need to wipe and start over but not entirely sure how to: (I know I should use virtualenv s but for the most part this has worked great 'till now.)
1) best uninstall, insure it is completely uninstalled and then re-install. It was installed/upgraded with pip (sudo)
2)I had previously installed IPython Dev via git, but see no trace of similar instructions for Jupyter? (this looks like it might be the answer to this part? Fail Jupyter Notebook installation on clean Ubuntu 14.04 LTS
don't want to dig myself a deeper hole...

If anyone else manages to mess it up as badly as I did...
Well I got it mostly sorted out... I removed anaconda from my bashrc file.. then I removed all instances of IPython and Jupyter form my base system files.. I used Pip uninstall for most stuff and anything left I removed via the file system, I checked carefully in the system dist-packages folder as well as numerous others using locate and find to make sure I killed it all. Then a sudo install Jupyter and a "python setup.py install" in the IPython extensions directory and I seem to be mostly back to normal....

Related

PyCharm cannot install packages

Short description: two computers in the same network, in the new one only those python scripts work that use native packages.
I have Pycharm in my old computer and it has worked fine. Now I got a new computer, installed the most recent version of Python and Pycharm, then opened one of my old projects. Both the old and the new computer are in the same network and the project is on a shared folder. So I did the following:
File - Open - selected the project. Got a message that there is no interpreter
Add local interpreter - selected the latest Python 311 exe. So location of the venv is the same as in the old computer (because it's a network folder) but Base interpreter is pointing to the C drive of my new computer.
PyCharm creates a virtual environment and the code runs fine.
I select another project which uses imported packages such as pandas. Again, same steps as above, add local interpreter. Venv is created.
I go to File - Setting - Project and see that pip, setuptools and wheel are listed as Packages. If I double click one of these, I can re-install and get a note that installation is succesful, so nothing seems to be wrong in the connection (after all, both the old and the new computer are in the same network.
I click the plus sign to add a new one, search pandas. Installation fails. Same thing if I try e.g. numpy.
Error message has lots of retrying, then "could not find the version that satisfies the requirement pandas (from versions: none", "not matching distribution found for pandas" (pip etc. have the latest versions).
After few hours of googling for solutions, I have tried the following:
Complety uninstall and reinstall python and PyCharm. Checked that PATH was included in the installation.
Tried launching pip command from shell
Changed http proxy to auto-detect
Typed 'import pandas' in PyCharm, then used the dropdown in the yellow bulb but there is no install option
Started a new project in the new computer, tried to install pandas
All failed. I'm surprised that changing computers is this difficult. Please let me know if there are other options than staying in the old computer...
If you want to use venv in the network, please use SSH interpreter. Pycharm supports this method. Shared folders are not a recommended usage, For pycharm, it will consider this as a local file. If the file map is not downloaded locally, it will make an error.
Another way is to reinstall the project environment on the new computer through requirement.txt. Reasonable use of requirements.txt can effectively avoid many project bugs caused by environment migration or different dependent versions. Before installing some scientific module such as pandas, it is recommended to install visual studio build tools, such as gcc ...
This took a while but here is what happened. Package installation did not work in project settings. Neither did it work when you select Python Packages tab at the bottom of the screen. The only thing that worked was to select the Terminal tab and manually install (pip install) there. We use a trusted repository but for other users, the easier package installation methods work. Not sure why they do not for me but at least there is this manual workaround.

How do I remove python installation and all the packages I installed for a fresh start

I installed Python 3.8.8 on my mac with anaconda. I also installed homebrew and mongodb. I added a couple of other things following different kinds of tutorials but now it is a whole mess on my macbook. I want to remove everything and start afresh. The tutorials I have seen do not seem to address my issue, it seems there is no python launcher on my install and most of the commands like : ln -s -f /usr/local/bin/python3.7 /usr/local/bin/pythondo not seem to work. I want a fresh restart. What do I do without loosing my softwares and documents?
The above commands don't work since you installed Python with the Anaconda distribution. So you need to head over to the Anaconda documentation for uninstall instructions https://docs.anaconda.com/anaconda/install/uninstall/#uninstalling-anaconda and I'd recommend using option B: anaconda-clean.
Note that an Anaconda installation behaves differently from a standard Python install and that it's worth getting familiar with the basic concepts beforehand.

Problem Installing Python Package from Bitbucket Repository

I'm having a crazy problem installing a package I built and placed in a bitbucket repository to a local environment.
I built the package.
I was successfully able to connect to it from Pycharm locally by doing:
pip install -e path/to/repository
I then pushed the built package to bitbucket.
I then switched local environments and pip installed the package from bitbucket as follows:
pip install git+https://my_name#bitbucket.org/my_company/my_repo.git
The package successfully installed locally.
I see it in pycharm and pycharm sees it in the environment site-packages. It looks like this:
I can't tell if it is installed properly but I note there are no .py files.
The script in this environment doesn't see the package.
I get the following error:
Any guidance on what could be wrong? Again, everything works fine when I'm local and using pip install -e. The code works. Just can't get it to work from pushed distribution packages from a remote repository.
Thanks in advance.
I don't know if this counts as a true solve but got it working. And after about 10 hours of work on this I'm not exactly sure how. I believe the issue may boil down to a stray comma - yes a comma - in the setup file which was not enough to throw an error but somehow left the build without some necessary parameter which resulted in a bad build when trying to install from the repository.
This also raises questions for me as to how pip install e works. This because my local editable install worked fine.
Very troublesome that I can't definitively identify the cause of this issue though I've seemed to resolve it.

'python' points to anaconda installation

I've installed anaconda, but I still want to use python as normal within a Terminal window (zsh). At the moment, running which python shows /Users/USERNAME/opt/anaconda3/bin/python.
I don't want this command to point to my anaconda installation. I want to use python as I have in the past, and for it to point to my python 2.7 installation (/usr/bin/python).
The same issue is present with pip and with python3. How do I change these paths back to their default locations?
I want to start out by saying I personally have never used Anaconda, but I have many friends who have and they always seem to wind up getting into hot water as far as configurations go. If you don't need the data-science specific tools that Anaconda offers (most of which I imagine you can get just as easily by using pip install <package_name>), then I STRONGLY urge you to not use Anaconda. I would suggest you instead use homebrew to install python 3.7 and leave the system version of python 2.7 alone... Anyways...
I recently fixed an issue similar to the one you're describing for a friend. I ended up deleted his anacaonda build and reinstalling fresh from homebrew (link: https://brew.sh/), so this is how I helped him and hopefully this will help you too.
Firstly, I would check the configuration of your ~/.bash_profile (or potentially ~/.bashrc) file. Comment out any lines you find that have to do with Anaconda by preceding with the # character. I believe when anaconda installs it puts the location of the anaconda-version-of-python higher in the PATH hierarchy, therefore you computer sees it first before it has the chance to look in /usr/bin...
Secondly, you need to move the anaconda-python to the trash... I would start by trashing the whole '/Users/USERNAME/opt/anaconda3' directory. If memory serves me correctly anaconda stores other python related things in the /MacitoshHD/Library/Frameworks directory, but don't quote me on that. I would advise looking there and trashing whatever seems to be related to the anaconda install.
After that, in a new terminal (so that your PATH refreshes), I installed homebrew, and then ran the command brew install python3 to install python3. I think perhaps I ran the command recommended in the installer output, something like "brew link python3" to symlink python3 where it needs to be linked after the installation.
Finally, everything is done python2 and python3 are installed and working with no issues. python2 is the system default version and python3 is the homebrew installed version. Feel free to ask any questions and I will try to help more, hopefully those instructions will get you started though.

pip.exe has stopped working

I know this question has been asked a few times before, but none of the answers I've read have managed to solve my problem.
When I try to run any of the following, I get an error saying "pip.exe has stopped working:
easy_install
pip
pip3
It was working for me previously (the last time I used it was probably a month ago), but not anymore. I'm using Python 3.4.4, I checked the PATH and it's configured correctly. Does anyone know what else might be causing the issue?
I had the same problem before and the solution is quite simple.
First try updating pip via command:
pip install --upgrade pip
If that doesn't work try uninstalling current version of python and reinstalling the newest version.
Note1: Do not just delete install files and files in your C drive ,uninstall everything packages, everything that might cause problems, especially delete old python packages and extensions they might not work with the newest python version and that might be the problem. You can see in python website which packages and extensions are supported.
Note2: Do not and I repeat DO NOT install .msi or .exe extensions they don't work anymore always use .whl (wheel) files. If you have one .msi or .exe uninstall them form your system completely; that also means that you have to uninstall them from command prompt.
Note3: Always check if the .whl is compatible with your Python version.
Note4: Also don't forget to save your projects before doing anything.
Hope that works :D
Happy Coding.

Categories