Pyscopg2 SSL Anaconda Support not compiled in - python

I am having the following issue with psycopg2. I am connect to a remote postgres server that is running 9.4.5.
I get the following error when I use SSLmode:required
OperationalError: (psycopg2.OperationalError) sslmode value "require" >invalid when SSL support is not compiled in
I am running Anaconda fully updated with psycopg2. I have deleted and reinstall Anaconda, removed and re-installed pip install psycopg2. Followed the brew install / brew uninstall suggested.
I have looked into the following threads from stack ==>
Psycopg2 Python SSL Support is not compiled in
as well as many other resources on the internet without success.
If anyone can help me out that would be fantastic - I feel like I have maxed out on my own abiliti to resolve this - hence I am posting up on Stack! Thanks

#cel resolved this for me in the comment thread above.
After working through all the different options it looks like using the
conda install -c conda-forge psycopg2=2.6.2
solution is the workaround that indeed worked for me.
If anyone has other resolutions let me know and I will add them here. I hope noone has the same issues.

Related

The `GLIBC_2.29 not found` problem of the installation of transformers?

To run transformers I installed it on CentOS 8 by
conda install -c conda-forge transformers=4.12.2
following the method on this page, but I still encountered the same error:
version `GLIBC_2.29’ not found
Then I tried to install that from the huggingface channel and got stuck by lots of conflicts.
conda install -c huggingface transformers=4.12.2
At last I tried to install the glibc231 myself, and downloaded the rpm from this link, but I saw the following error, leading me to think that I would be in the wrong direction:
Error: Problem: conflicting requests
nothing provides glibc-common = 2.31-3.gf.el7 needed by glibc231-2.31-3.gf.el7.x86_64
nothing provides glibc-langpack = 2.31-3.gf.el7 needed by glibc231-2.31-3.gf.el7.x86_64
Any suggestions? Thanks in advance.
I had the same issues, and I downgraded to the following version:
tokenizers=0.10.1
transformers=4.6.1
I also encountered this error. If you don't want to downgrade (which may or may not lose features), I solved it by building it from sources. You can find the instructions here:
https://huggingface.co/docs/tokenizers/python/latest/installation/main.html#installation-from-sources
Note at least two caveats in the guide above:
The process will ask you to install rust, which is a language very robust to different platforms. You might even have it on your system if you've worked with rust before, but in that case do remember to update your rust toolchain with rustup update.
If you follow the process exactly, you will install the latest commit on master, which might or might not be a good thing. I recommend you select your desired version and do a git checkout ... first before you run python setup.py install.

CQLSH ImportError: cannot import name ensure_str

I have installed Cassandra database on my CentOs system. after that, I tried to install the Cqlsh package using this command sudo yum install cqlsh and it has been installed successfully. but when I tried to run cqlsh from the terminal, the following error appears:
ImportError: cannot import name ensure_str
somewhere in the code, it tries to load a library named six that contains ensure_str. the error does not say that it can not find a module named six, the python interpreter can find the library but can not import it!
I have tried googling but none of the solutions worked for me.
after a few hours of googling and struggling with the code, finally, I find out the solution. and I'm going to share it with others.
apparently, the problem is the new version of six (v=1.7.3) which is not compatible with my system. However, Cassandra copies the last version of six into the following path:
/usr/share/cassandra/lib/six-1.7.3-py2.py3-none-any.zip
then cqlsh try to force the python interpreter to import the library from this path by adding the following lines to the code.
third_parties = ('futures-', 'six-', 'geomet-')
for lib in third_parties:
lib_zip = find_zip(lib)
if lib_zip:
sys.path.insert(0, lib_zip)
no matter if you have another version of six installed on your system, it always tries to import the library from the Cassandra folder.
So, I have just deleted these lines from cqlsh file using this command:
vim /usr/bin/cqlsh
Then I try to install the last compatible version on six using this command:
yum install six
That's it! problem solved and now I'm using cqlsh without any problem.
I hope it helps others.
We've had reports of this being a problem on CentOS specifically with version 6.7 but it possibly affects the 7.x releases too.
It appears that the wrong Python is getting called. This isn't strictly a Cassandra issue but a problem with the Python on the machine. You can verify which Python gets run with:
$ which python
As a workaround, you should be able to run cqlsh using the system Python as follows:
$ /usr/local/bin/python /usr/bin/cqlsh
Cheers!
Use pip3 to install or upgrade to the current six.
Edit a copy of cqlsh. Change
third_parties = ('futures-', 'six-', 'geomet-')
to
third_parties = ('futures-', 'geomet-')
Not proud, but it worked.
Used pip3 to install, and found this issue as well.
For me, removing six dependencies from /usr/lib/python3/dist-packages was the only thing that worked.
rm six-1.11.0.egg-info and rm -r six-1.11.0.egg-info
I couldn't uninstall it with pip3, so manual removal was the way to go, followed by a pip3 install six
Once that was back in place, cqlsh ran without issue.
The previous answers didn't work for me, I had to delete the Cassandra included six package, and then cqlsh used the system-wide package.
mv /usr/share/cassandra/lib/six-1.7.3-py2.py3-none-any.zip /usr/share/cassandra/lib/six-1.7.3-py2.py3-none-any.zip.bak
Maybe an older version of Cassandra installed, and a newer version of cqlsh?
https://community.datastax.com/questions/12085/unable-to-connect-to-cqlsh.html

File already exists in database error from Protobuf when deploying Google Dataflow template after MacOS Catalina upgrade

I have a project that uses Google Dataflow. I have been successfully using the following command (and commands like it) for months to deploy templates.
.venv/bin/python -m dataflow.registry_files.delimited_file --runner=DataflowRunner --region=us-central1 --project=myproject --staging_location=gs://mybucket-staging/staging/gr265 --template_location=gs://mybucket-code/templates/gr265 --temp_location=gs://mybucket-staging/temp/gr265 --no_use_public_ips --save_main_session --setup_file=dataflow/setup.py --projectId=myproject --datasetId=padl_staging --tableId=gr265 --configFile=gs://mybucket-code/registry/registry_files.yaml --fileType=gr265
This command continues to work on windows 10 and Debian machines in my team.
Since I upgraded to catalina (10.15.1, with python 3.7.5 and apache-beam==2.16.0 ) I get the following error:
[libprotobuf ERROR google/protobuf/descriptor_database.cc:58] File already exists in database:
[libprotobuf FATAL google/protobuf/descriptor.cc:1370] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
Abort trap: 6
I have done all of the following, with many reboots:
Run xcode-select --install
Run brew update-reset, brew update, brew upgrade, and brew reinstall python all to no effect (except after brew update-reset, brew doctor works again)
Run brew uninstall protobuf and brew install protobuf
Run pip3 uninstall protobuf outside of the virtual environments
Deleted and re-created my virtual environments from their requirements files.
Several bits of voodoo involving /usr/local/include that I located elsewhere on stack overflow that didn't help.
I wondered if this was just my machine, and unfortunately was able to reproduce it on the other macOS Catalina laptop in my team, but not the laptop still running macOS Mojave.
According with the Apache Beam Issue 8368 this issue is related with a pyarrow version, you have to test with pyarrow 0.15.1 beam since is the one which works on MacOS 10.15 as is mentioned in this link.
Please let us know how it works.
I just leave it here, because it is a common problem has not resolved by maintainers and I didn't found the closest convenient solution in the time.
https://github.com/protocolbuffers/protobuf/issues/1941
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=721791;filename=protobuf-2.4.1-3.1.debdiff;msg=5
The patch actually quite does not help, because in the next step the protobuf does hang in the Run function and call does not return.
The closest solution for myself was to completely avoid of any double linkage with the protobuf at any cost.

conda update crashes python

I'm trying to update/upgrade my Python with conda. I run the command:
conda update conda
but it crashes my Python:
Python has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
My installation information is:
conda version : 4.5.2
conda-build version : 3.0.27
python version : 3.6.3.final.0
I googled the issue and got this github issue report. Unfortunately none of the solutions worked for me. I would appreciate if you could help me know what is the problem and how I can solve it.
I tried uninstalling and reinstalling conda and the problem disappeared temporarily. But then the issue happened again while I was trying to use matplotlib.
I experienced the exact same issue one a different machine when running conda update --all so either there is something wrong with conda or I'm making one mistake twice! (conda/python versions were exactly the same as above.)
I tried updating/upgrading all of the packages running the command in this post on admin-cmd. It took a long time to finish and the problem was still there.
There seemed to be issues with Qt. So I tried to uninstall and reinstall Qt and pyqt but it did not solve the problem either.
temporary workaround: I completely uninstalled Anaconda and installed stock Python. So far this has solved the problem both on my home and work computers.
Try conda update --all or if you're trying to update / upgrade specifically python then try conda update python. Faced such problem and it worked for me.
As was suggested by the mods, here I post my temporary solution. Considering that none of the other attempts (reinstalling Qt, Anaconda, updating with pip...) worked, I ended up uninstalling Anaconda and everything pythony and installed the stock / vanilla python from the official website. This has solved the issue so far. Please consider this is not a solution to the problem mentioned above but just to get the python working for the time being.

Installing mysql: No libmysqlclient.18.dylib (OS X)

I have installed mysql and MySQLdb but my computer doesn't have libmysqlclient.18.dylib however, there is a libmysqlclient.20.dylib.
What can I do to fix this problem?
There are some questions that suggest to create a link but I don't have file named libmysqlclient.18.dylib how to create the necessary link?
Usually installing packages using package managers like homebrew fixes such problems. In your case, installing mysql using brew may fix the problem.
brew install mysql
This way, creates needed filesystem links and therefore python packages work well.
BTW, you can upgrade the python package to match installed mysql binaries.
Ok, I managed to fix it. I think I may have installed mysql5.7.x, but, mysql5.7.x had libmysqlclient.18.dylib. Now, after I installed mysql5.6, the problem is gone!
Steps I took to solve this problem:
brew uninstall mysql
brew update
brew tap caskroom/versions
brew install homebrew/versions/mysql56

Categories

Resources