Complete removal and fresh install of python on Ubuntu 12.04 - python

This is embarrassing to admit, but I just continue to struggle with setting up my Python environment on an Ubuntu install.
Sometimes I get it to work fine. But here's the problem:
I feel like whenever I sit down to do some hobby hacking on a python project, I end up spending hours on end just trouble shooting inconsistencies with my python installation. Right now I keep getting an error message of:
ImportError: cannot import name urandom
when trying to import a module called googleplaces (https://github.com/slimkrazy/python-google-places).
But it's always something that causes me to go on an endless snipe hunt for the proper configuration of this that or the other.
I just want to work on the project, not plumb around endlessly in forums.
Which brings me to my point: How do I completely nuke my existing python setup (including virtualenv, pip, easy_install, etc. etc.) and just start from a completely clean slate? I have already tried reinstalling everything python from synaptic, but no success, still getting error.
UPDATE: I've reinstalled virtualenv and that seems "ok" so far. Found that my import error is a permissions problem, if I import in the interactive using sudo, it passes fine. How should I be correcting my permissions so I don't have to run sudo? (Probably close this and start a new question.)

Related

pycharm is not installing packages

So I am trying to create a chatbot in pycharm so I set up all the code and when I tried to run it, it gives me a error message saying can't find 'main' module in 'C:\Users
So I tried fixing it by setting up a new folder called virtual environment yet it gives me the same error
On the off chance it doesn't give me that error it tells me it cannot input chattterbot so I go to project interpreter to try and install it, it gives me the error message
Error occurred when installing package 'Chatterbot' I dont get why this does it while chatterbot-corpus works perfectly fine.
I tried as I said making a new virtual environment but that didnt work so after switching the new virtual environment I made and trying to put chatterbot in manually it didnt work and nothing showed. So going back to the original environment that was created when I started this project. But the same thing keeps happening it just wont install even if other programs install no problem. I looked this problem up and I found one post saying it might be setuptools fault so I down graded to the version that they said it would work but to no avail. It always comes up as Error occurred while installing package 'Chatterbot' I dont know if its something wrong with the files on my computer or the way im trying to install chatterbot. The major problem that really stumps me is that this seems to be a problem for only chatterbot and nothing else and I cannot figure out for the life of me why.

Problems with importing external module

I tried to download an external module to test how it works, by simply downloading 'Simplejson' using pip in cmd(Window). I watched my teacher did it, and followed it the exact way but i ran into a problem.
Not sure what i did, because my teacher just told me to follow him, i think we created a virtual environment on python so that we can do more than one projects with various versions of python. Anyway, most of you will know that after creating a virtual environment in my folder that i work for coding, a 3 new folders will appear and 'Simplejson' will be inside Lib\site-packages. Even if i checked that Simplejson is still inside the file, some how i can not import it. Are there any way that i can solve it?
enter image description here
Please refer to the following to check the process of installing and using the module "Simplejson" in VS Code:
Please check whether the python currently used by the VS Code terminal is the same as the one displayed in the lower left corner of the VS Code: (python --version or pip --version)
(If they use different pythons, please open a new VS Code terminal, it will automatically enter the selected environment.)
Then install the module "Simplejson".
Check the installed modules: (pip show Simplejson)
Run:
Reference: Python Environments in VS Code.

Assertion Failed nbytes==sizeof (dummy) zeromq/src/signaler.cpp:402 Python.exe stopped working - Jupyter Notebook

I was successfully able to install Jupyter Notebook, with Anaconda. Everything was working fine, until suddenly one fine day I started to receive this message. Its happening when my Kernel is running for about continuous 1-1.5 hrs continuously.
I had gone through all possible solutions over Github, and did the following stuffs:
Uninstalled networkx
Turned off Firewall
Checked whether there is any anti-virus in my system, but there is none.
Since doing these did not fix the issue and ultimately I uninstalled zmq:
pip uninstall zmq and now I get this message:
Although I'm getting this message, but it seems that its not crashing automatically, I have to check for a longer time though. But I think that I'm doing something wrong, or something is there I'm not able to understand.
My OS is Windows 10, with only Windows Defender (Real-Time Protection) turned on, but previously also I had my Firewall and Defender both on, but never had this issue, suddenly I'm having all this problem. I didn't install anything, nothing.
I have found that if you change the port no. in signaler.cpp file, it may solve the issue, but at least if someone can help me locate the file atleast, I'm not able to find it under library folder in Anaconda packages.
P.S. If anyone can also tell me the significance of zmq library and whether it is important to keep it. Also I'm getting ssl error everytime I try to pip-install a module. So I have to write extra trusted link to do the installation.

pip hangs after installing package

I'm using Python 3 on windows I'm trying to install a package from within a script.
The purpose is that I don't want to explain to the person I'm sending the script how to install the packages he needs, so I'm hoping to do it on the fly from within the script.
Here's my code:
import pip
pip.main(["install", 'pyetrade'])
import pyetrade
Everything installs correctly with pip.main, however it doesn't move on to "import pyetrade" or the rest of the code. It just hangs there.
Any ideas how to get around this? This also seems to happen when I use the command propt -- it seems to just hang after installation.

'Web' module cannot be found while having installed lpthw.web

I'm currently doing the exercise in "Learn python the hard way".
In this exercise i have to install the lpthw.web frame work.
Having installed pip in windows, i open my terminal and hit
pip install lpthw.web
Everything then ends succesfully.
But when i browse C:\Python27\Lib\site-packages\lpthw.web-1.1-py2.7.egg-info and check the installed-files text i can't see the web.py.
Consequently when i try to import it in a simple script i get ImportError.
I don't have python 3 installed as book suggested for possible cause, so i don't know how to work around it.
Any suggestion?
I checked my path
import sys
sys.path
and saw that every single line was using the panda3d path.
As i was not really using it, unistalling it fixed my problem.
For me it was python version control on raspberry pi
(linux) 2.7 is default and does not work.
follow:
https://learn.sparkfun.com/tutorials/python-programming-tutorial-getting-started-with-the-raspberry-pi/configure-your-pi
have other errors now but the import web loads in python.
cheers!

Categories