From the description of Dtls library, it seems it's not available in python3. And when I want to install with pip install Dtls there's always an
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\sun\AppData\Local\Temp\pip-build-c_46y9mt\Dtls\
Solution here doesn't help. I am using Python 3.6 on Win7.
Do I have another option for DTLS?
python3-dtls is the python3 version for dtls package.
If the library you want to use is not available for the version of your interpreter, then you simply cannot use that library without porting it yourself or waiting for others doing that for you. This is probably not what you want.
This means that Dtls library works only for Python2.7 and version 1.0.0 or higher of the OpenSSL library as mentioned on the website, although it's tested on several plattforms (including yours):
At the time of initial release, PyDTLS 0.1.0 has been tested on Ubuntu 12.04.1 LTS 32-bit and 64-bit, as well as Microsoft Windows 7 32-bit and 64-bit, using CPython 2.7.3. Patches with additional platform ports are welcome.
As of release 1.2.0, PyDTLS is tested on Ubuntu 16.04 LTS as well as Microsoft Windows 10, using CPython 2.7.13.
You can use other libraries if you have to use Python3.x, e.g. standard ssl library or maybe also pyOpenSSL library:
pyOpenSSL remains the only alternative for full-featured TLS code across all noteworthy Python versions from 2.7 through 3.5 and PyPy.
Dtls is a library which simplifies implementation but you are not dependent on it.
Just as a side note: For pyOpenSSL you can also get an idea how to implement it by reading this post.
Related
I'm getting this error:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/crypto.py:14:
CryptographyDeprecationWarning: Python 2 is no longer supported by the
Python core team. Support for it is now deprecated in cryptography,
and will be removed in the next release. from cryptography import
utils, x509
I have tried updating the cryptography module and python. What is the solution to this problem?
macOS Monterey ships /usr/bin/python as Python 2.7.18 along with a set of default packages. This Python is provided as a final fallback for compatibility with legacy software. When executing this Apple provided Python you will see the following initial message:
WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using 'python3' from within Terminal.
Since they are shipping a set of packages that they have shipped for years, this includes cryptography, which also deprecated Python 2 support and began raising warnings about dropping support in version 3.3. Apple ships version 3.3.2, which is the final version of cryptography that supported Python 2.
The only true resolution to this is to stop using Python 2. You can install a newer Python from python.org, use tools like pyenv or conda, or use Apple's Python 3, but migration is required. And, of course, Apple will likely drop their py2 installation next year when macOS 13 is released.
Edit: Apple actually dropped Python 2 in macOS 12.3.
I have been trying to install PySide6 on my PC (Windows 10 64bits) with Python 3.9.0 installed, but I keep getting errors every time.
I used the command pip install PySide6 It is not working for me.
Any help will be appreciated.
Error:
ERROR: Could not find a version that satisfies the requirement pyside2 (from versions: none) ERROR: No matching distribution found for pyside2
Check if you Python installation is 64 bit and not 32 bit. It has an impact on compatible and thus available binaries.
At the time of writing:
The problem is that most of the binaries are not yet compatible and are not yet compiled for Python 3.9 at the time of writing. If you want the best compatibility, use Python 3.7 or Python 3.8. Most of the packages have been compiled for Python 3.8 but not many for Python 3.9.
For the future people that come here:
I would recommend you to keep one minor version behind the current stable release to not face dependency problems as the above section explains.
For Example:
If current stable release is Python 3.12 then you should install Python 3.11 or Python 3.10. Just one or two versions behind the current stable release.
I'm trying to build Tensorflow from source (if I install directly it works fine but I'm trying to get AVX2/FMA extensions support as I can't use CUDA/GPU) and I'm following this tutorial to build Tensorflow 1.15 (which is needed for the project that I use, I can't use 2.x).
I've built Tensorflow successfully, but when I try to install the wheel with pip I get the following error:
ERROR: tensorflow-1.15.5-cp37-cp37m-macosx_11_0_x86_64.whl is not a supported wheel on this platform.
Well, I know what the error means but the problem is that:
The wheel, as implied by the filename, is built for:
Python 3.7
macOS 11.0
x86/64
Which is already what I have (yup, double checked Python version, it's exactly Python 3.7.9, and no I'm not on M1 if that matters, I'm on Intel Mac). Why am I getting this error message even though I'm on the platform that the wheel is built for?
UPDATE: I'm already on the latest pip as of writing, and I can verify pip and python point to the same version:
(tf) can#can-mbp tensorflow % which pip
/opt/anaconda3/envs/tf/bin/pip
(tf) can#can-mbp tensorflow % which python
/opt/anaconda3/envs/tf/bin/python
(tf) can#can-mbp tensorflow % pip -V
pip 21.0 from /opt/anaconda3/envs/tf/lib/python3.7/site-packages/pip (python 3.7)
(tf) can#can-mbp tensorflow % python -V
Python 3.7.9
FOR MACOS - BIG SUR
I was able to solve this problem when I found that the version of the macOS operating system does not match the version actually recognized by python
I'm using macOS 11.4, the file is with this version. But when typing a command in the terminal, I found that python recognizes 11.0.
python3
from distutils import util
util.get_platform()
>> 'macosx-11.0-arm64'
generated file name:
opencv_python-4.5.2+2344814-cp39-cp39-macosx_11_4_arm64.whl
new file name:
opencv_python-4.5.2+2344814-cp39-cp39-macosx_11_0_arm64.whl
Upon #Axe319's comment I took a look at https://github.com/apple/tensorflow_macos/issues/46 and seen that simply changing the wheel's filename's OS section to 10_9 works. There is probably a bug with parsing macOS 11.0 or Python doesn't think it supports 11.0 (maybe that particular Python/pip version was before Big Sur was released).
Make sure the Python version you are using (32/64 bit) does match what the wheel requires ;)
I'm trying to implement the answer found at Python Paste SSL server with TLSv1.2 and Forward Secrecy.
How do I use context.set_tmp_ecdh()? That method is not defined on either my Linux or Windows machines. It is in the pyOpenSSL docs, and various examples I've seen. I'm using Python 2.6.6 (or 2.7) and pyOpenSSL v 0.13 (specifically CentOS package pyOpenSSL-0.13.1-2.el6.x86_64.rpm). Is there a specific version or additional dependency, etc. that I'm missing?
Support for ecdh was added in pyOpenSSL 0.15, so you can't use it with your installed version of pyOpenSSL.
You'll have to install a newer version.
Is there a procedure to install Theano for Python 3.4 64bit on Windows 7, manually, without using any of the bundles?
I wrote a step by step tutorial on this today, check it out at:
http://www.islandman93.com/2015/04/tutorial-python-34-theano-and-windows-7.html
Some specifics from my post:
As user2805751 said, you'll need LibPython, Numpy, and Scipy.
You'll also need: MinGW http://mingw-w64.yaxm.org/doku.php/download
Installing Theano with python setup.py install will automatically do the 2to3 conversion.
If the above PR doesn't work, I was able to get the following working for windows 8.1 64 bit (python 2.7.8, but you might try 3.4)
http://pavel.surmenok.com/2014/05/31/installing-theano-with-gpu-on-windows-64-bit/
I needed to also install the LibPython package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#libpython inorder to fix an ld linker problem.
There is no such instruction. There is a new PR with instruction that do not use any bundles, but it is for python2. You can try it, but change python2 for python3:
https://github.com/Theano/Theano/pull/2155