I'm having issues installing pyscopg2 on Mac OSX - psycopg2

ok, so I have researched the other topics on this, but I still can't get this thing to work, and I'm sure its something small I'm overlooking.
I have my python script running on my local host as a web service.
I have my postgresql instance running on my local host with a specific port, and a database created with a table that has data.
All I want to do is utilize psycopg2 to connect to my database from the python script. Should be pretty simple.
Now, as I understand it, I should be able to just download the psycopg2 file, run the setup, and move on from there.
Could someone PLEASE point me in the direction of how to do this? The python setup.py build and/or install command results in permission denied, which is just odd. I ran it with sudo, and again, same thing.
This is the last piece I need to get in place before I can continue working on the application that I was working on.

Have you tried using pip?
pip search psycopg2
if not installed
pip install psycopg2

Related

Problem with "import rarfile" in python on Ubuntu

Today I turned on my Ubuntu virtual machine and tried to do a project in Python 3.9.4,
but this one used rarfile module. Which is throwing errors.
I know rarfile uses unrar, and I installed both rarfile and unrar.
Tried to type unrar seperately and it works.
I almost spent whole day trying to figure this out.
My question is why does importing rarfile module not work, and how can I fix it.
I also read online it could have something to do with PATH, but I am pretty new to linux and don't know terminology of it and therefore don't know how to try to fix it.
Some information regarding that would probably help if not now, for the future problems regardless if it is connected to this problem or not.
Sorry if I formatted this post poorly, it's my 2nd post on here.
I would do pip install rarfile to make sure it is install
also you may want to do a pip list to make sure its intalled.
Also if python 2 is install then most likly you need to do pip3 install rarfile.

_tkinter.TclError: couldn't connect to display "127.0.0.1:0.0"

I have written a Python Scraper with Selenium and in that I have to tackle the 2FA,so, I am prompting for the user input to get the code and move forward, everything is working smoothly in local machine and the whole script is executing correctly and providing the desired output.
Now, as I have deployed the Application to Ubuntu Server on Linode machine, the pymsgbox is not opening on the server and I am getting the following error,
couldn't connect to display "127.0.0.1:0.0"
I downloaded the library from the following command,
sudo apt-get install python3-tk
I have tried all the possible solutions whether that is on Stackoverflow, superuser, reddit, ASK etc but not working.
Please let me know if I am missing something.

Can't find PyInstaller when installing through pip on Python 3

I am trying to install PyInstaller.
I went to my command prompt and types in:
python -m pip install PyInstaller
After doing a few retry's it gives me the message
The impression that I get from your error message is that the issue is not specific to PyInstaller, but rather that there's a general issue connecting to the Python Package Index server.
I would advise to double check that your machine is able to connect to the pypi.python.org domain (e.g. do a simple ping test).
Thanks for your help Xukrao.
The ping did not work so as you suggested I spoke to our IT guy who knew right away that it was a proxy issue and needed to input something like below to get it working.
[user:passwd#]proxy.server:port

Installing Python2.7 on a linux server without root privileges

I am trying to install python2.7 over given python2.6 on a web server. I am stuck at the last step trying to link new python install over the old one.
The steps I have done:
Downloaded and extracted Python 2.7
configured with --prefix=$HOME/.local
make install
What I don't get is how to link by making changes in .bashrc (and what changes to make). I looked over all the places but most the answers are not generic.
Also, I have to install couple of other lovely python stuff, like pip virtualenv, django, nltk over this. A little help on that would be too great.
Ok, without root privileges you will have to have all the python stuff and your code in your home folder. And also you won't be able to configure your nginx/apache/whatever http server you use. Does not seem like a good idea for production, but for development - sure, why not.
This means you will need to install python in your home folder. You can download and compile, but probably the simplest way to do so is pyenv - https://github.com/yyuu/pyenv. Some reading is required to understand its concepts, but it is much simpler than fiddling with manual compiling if you are not sure what you're doing.
Also it kinda replaces virtualenv, but you can still have it if you want. And of course, it all works with your non-root user. There is an installer that doesn't require root either.

Cloud9 on Raspberry Pi, Unable to save files

I'm trying to get the cloud9 local server working on my Raspberry Pi(512mb model B, running raspbian).
I followed this installation guide:
http://www.slickstreamer.info/2013/02/how-to-install-cloud-9-on-raspberry-pi.html
After this installation everything appeared to be working properly, I can start the server with the following command:
~/cloud9/bin/cloud9.sh -l 0.0.0.0 -w ~/Documents/www/workspace/
when I start the server all the files in the workspace are displayed properly and I can view, duplicate, delete, and create files remotely no problem. But when I edit an existing file and try to save it remotely a little spinning wheel pops up on the tab of the file I'm saving and it continues to spin endlessly.
When I start the server a warning pops up saying: 'path.existsSync is now called fs.existsSync.' I'm not sure if that is relevant or not.
I found another thread somewhere saying that I should go through cloud9/configs/default.js and replace any instance of localhost with 0.0.0.0. I tried that, but it didn't fix my problem.
Does anyone have any suggestions about how to get cloud9 saving files properly?
Thanks in advance for your help.
There were several complains about IDE file saving hangs on cloud9 support. At the bottom of the page there is a solution you can try.
I fully removed cloud9 and node(followed these directions to remove node: Uninstall Node.JS using Linux command line?), and then did a clean install following these directions: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=30265. In addition to those commands I also had to run the following:
sudo npm install formidable
sudo npm install gnu-tools
sudo npm install xmldom
after that I was able to start the cloud9 server without issue, and now I'm able to save files.
thanks for trying to help

Resources