Python 3.6 pyrfc ImportError - c++

I have VM win7 x64, Python 3.6 and Im trying to install pyrfc SAP connector.
I have installed NWRFC library, set it in PATH variable, installed egg pyrfc-1.9.5-py3.5 with easy_install, and installed Visual c++ redistributable 2015 (x64) 14. But import always fails:
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrfc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\__init__.py", line 22, in <module>
from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\_pyrfc.py", line 7, in <module>
__bootstrap__()
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\_pyrfc.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
On same machine I have also Python2.7 - its using same NWRFC library and it works with no problem.
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrfc
>>>
What could be the issue? Or how can I trace the import to know which other library is missing?

On github there are issues related to this, and some people solved it by:
One person reinstalled SAP SDK:
after some troubleshooting at least in my case was fixed after I re-downloaded the SAP SDK making sure I was downloading the Windows version.
Another person said:
If I uninstall pyrfc v2.0.1 and reinstall v1.9.93 using pyrfc-1.9.93-cp37-cp37m-win_amd64.whl, it works even without needing env var SAPNWRFC_HOME.

Try:
pip install pyrfc
It works for me.

Related

how force python3.6 use new fresh install of openssl I installed new version of openSSL 1.1.1 on ubuntu, python2 does load it, but python3 doesn't

$python
Python 2.7.6 (default, Nov 13 2018, 12:45:42)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from cryptography.hazmat.backends.openssl import backend; print(backend.openssl_version_text())
/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.
utils.PersistentlyDeprecated2018,
OpenSSL 1.1.1g 21 Apr 2020
[11:14 PM] $ python3.6
Python 3.6.4 (default, Apr 21 2020, 19:02:28)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
from cryptography.hazmat.backends.openssl import backend; print(backend.openssl_version_text())
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/init.py", line 7, in
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 75, in
from cryptography.hazmat.bindings.openssl import binding
File "/usr/local/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 205, in
_verify_openssl_version(Binding.lib)
File "/usr/local/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 169, in _verify_openssl_version
"You are linking against OpenSSL 1.0.1, which is no longer "
RuntimeError: You are linking against OpenSSL 1.0.1, which is no longer supported by the OpenSSL project. You need to upgrade to a newer version of OpenSSL.

Installing tensorflow for Python 2.7 when already have for Python 3.5

I have tensorflow already installed for Python 3.5 in Ubuntu 16.04, and when I import it, I get the following message:
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
/usr/local/lib/python3.5/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
>>>
But with Python2.7, I get this:
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
>>>
I tried to install tensorflow after installing cuDNN, Cuda, bumblebee, nvidia driver etc., but after I rebooted, I couldn't get past the login screen. After a friend of mine fixed the problem, I still wanna use tensorflow with Python 2.7, how can I do so without messing up my system? I have cuda 9.1 installed.
Have you tried virtualenv to manage your pip packages? you can easily use it to avoid multi-version of tensorflow and Python,

APScheduler2.1.2 installed on python2.7, but still ImportError: No module named 'apscheduler'

Command Line activity Image
I have Python2.7 on windows.
Installed scheduler as
$pip install apscheduler==2.1.2
pip Listing shows the scheduler2.1.2
But keep getting:
U:\>python
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from apscheduler.schedulers.blocking import BlockingScheduler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named apscheduler.schedulers.blocking
>>> quit()
It look much cleaner in the image.
Thanks.

python ImportError: No module named Tkinter

Every time I tried to run import matplotlib,
I have error ImportError: No module named Tkinter.
The output result is as listed below:
Python 2.7.5 (default, Aug 2 2016, 04:20:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from six.moves import tkinter as Tk
File "/usr/lib/python2.7/site-packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/usr/lib/python2.7/site-packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/usr/lib/python2.7/site-packages/six.py", line 82, in _import_module
__import__(name)
ImportError: No module named Tkinter
I tried to install the tk.x86_64 and tk-devel.x86_64 packages, and tried to reinstall the python package but the error still appeared.
Also I tried to import Tkinter but I got the following error.
Python 2.7.5 (default, Aug 2 2016, 04:20:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Tkinter
Does anyone have a workaround for this error?
I'm using python2.7.12 on ubuntu16.04.
I installed it with this command:
sudo apt-get install python-tk
I tried to install tkinter package for python2.7.5 from the following link:
tkinter package
Also I found there is dependency library libTix.so()(64bit) for tkinter package and i got it from the following link: libTix.so()(64bit) package
after that i installed both then I could import Tkinter and import matplotlib.pyplot as plt with no errors.
My 2 cents. Open a terminal and type the following.
$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
If you do not get an error like below then your Tkinter is fine and the problem is with matplotlib. Then try removing and reinstalling matplotlib.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tkinter
I was getting the error "ImportError: No module named '_tkinter'" for python3.5 in-spite of installing python3-tk and tkinter-dev.
It showed the error in following file:
File "/usr/local/lib/python3.5/tkinter/init.py", line 35, in
import _tkinter # If this fails your Python may not be configured for Tk
It got resolved for me by simply running the python from /usr/bin like /usr/bin/python3.5 from terminal!
In short, please ensure the python version being run from terminal has the tkinter installed and configured :)
My PC configuration: Ubuntu16.04 with default python2.7 and python3.5
I faced the same issue on a RHEL 7 machine. There was no python-tk package that could be installed. I found the solution here which solved the issue for me:
sudo yum install tkinter
This should work for RHEL machines using Python 2.

"import wx" fails in PySCripter

I have a 64-bit windows 7 OS where I installed ArcGIS with 64-bit Python 2.7.
I also installed 64 pyscripter editor.
When I import wx from Python 2.7 IDE no isse - I get this:
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
>>> import wx
>>>
>
When I import from PyScripter - fails I get this:
*** Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32. ***
>>> import wx
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python27\ArcGISx6410.3\lib\site-packages\wx-3.0-msw\wx\__init__.py", line 45, in <module>
from wx._core import *
File "C:\Python27\ArcGISx6410.3\lib\site-packages\wx-3.0-msw\wx\_core.py", line 4, in <module>
import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>
Anybody can help me with this?
I think it is installing to the wrong location. Normally when you install Python packages, they get installed to C:\Python27\lib\site-packages. Somehow you installed wxPython to C:\Python27\ArcGISx6410.3\lib\site-packages. I would uninstall wxPython and when you re-run the wxPython installer, specify where to install it.
I should note that wxPython works fine for me on Windows 7 when it is installed in the correct location. I can import wx from both Python's interpreter and in PyScripter.