ImportError: No module named date_capnp - nupic

While trying to understand nupic minecraft demo code. I am running nupic_client.py from pycharm IDE. Python version is 2.7.8 on Mac OS with nupic dowloaded as package version 0.2.8
On running nupic_client.py following error occurs ImportError: No module named date_capnp
Any help is appreciated.
Stack Trace:
File "/Users/msghotra/Sandbox/CodeHub/datascience/workspace/nupic_minecraft/nupic_client.py", line 5, in <module>
from nupic.frameworks.opf.modelfactory import ModelFactory
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nupic/frameworks/opf/modelfactory.py", line 32, in <module>
from clamodel import CLAModel
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nupic/frameworks/opf/clamodel.py", line 44, in <module>
from nupic.encoders import MultiEncoder, DeltaEncoder
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nupic/encoders/__init__.py", line 24, in <module>
from date import DateEncoder
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nupic/encoders/date.py", line 28, in <module>
from nupic.encoders.date_capnp import DateEncoderProto
ImportError: No module named date_capnp

I believe you mean nupic==0.2.3, since 0.2.8 isn't out yet. This should be fixed with https://github.com/numenta/nupic/pull/2231. More details are available in the issue you referenced (the direct link is https://github.com/numenta/nupic/issues/2166). Hope this helps!
EDIT This should now be resolved in nupic==0.2.6

Related

Dll load failed

My code is this, this is a test code from a youtuber:
import numpy as np
import cv2 as cv
from tensorflow.keras import datasets, layers, models
import mathplotlib.pyplot as plt
(training_images, training_labels), (testing_images,
testing_labels) = datasets.cifar10.load_data()
training_images, testing_images = training_images/255, training_labels/255
class_names = ['Plane', 'Car']
for i in range(16):
plt.subplot(4, 4, i+1)
plt.xticks([])
plt.yticks([])
plt.imshow(training_images[i], cmap=plt.cm.binary)
plt.xlabel(class_names[training_labels[i][0]])
plt.show()
And this is what happens when I run it:
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "image classification test.py", line 3, in <module>
from tensorflow.keras import datasets, layers, models
File "C:\Python38\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Python38\lib\site-packages\tensorflow\python\__init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
I installed tensorflow from both anaconda and pip and same error happens, I cant seem to find a solution on this one so please help me out
The optimistic quick check, make sure you have the latest Visual C++ DLL installed.
I just encountered this myself; in my case the system I was trying to run Tensorflow on uses a G3220. According to Issue #39007 TensorFlow requires AVX extensions, which my CPU does not support. You can do a quick check to see if your processor supports AVX extensions by searching for it on the Intel Ark (Link to my G3220 which does not support AVX and a link to a i7-4790 that does support AVX. I suspect this is the same problem that you are having.
You may be able to compile TF yourself or use a build someone else made to run without AVX (see: Run TensorFlow 2.0 on CPU without AVX). In my case, I was able to use the unofficial TF python build referenced in this Stack Overflow answer to install TF 2.4 from here https://github.com/fo40225/tensorflow-windows-wheel.
Intel Ark i7-4790 AVX Example Image

Tensorflow - ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed

I am struggling to utilise TensorFlow within Jupyter notebook. I have installed TensorFlow via Anaconda Prompt (running as admin). But when I go to call it in my notebook I get the following error string (sorry this is long).
Any help or thoughts would be welcomed here - should I run a full uninstall and try again?
kind regards
Jack
I am running:
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
The error message is as follows (there are a number of others but this is the first and the rest have similar issue):
Traceback (most recent call last):
File "C:\Users\jjcon\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\jjcon\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\jjcon\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\jjcon\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\jjcon\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
You have to install the Microsoft Visual C++ 2015-2019 Redistributable (x64) from here.
If you are facing any other issues possible reasons are
Your CPU does not support AVX2 instructions
Your CPU/Python is on 32 bits
There is a library that is in a different location/not installed on your system that cannot be loaded.
Please refer tested build configurations for windows CPU and GPU.

pgadmin4 showing 500 (INTERNAL SERVER ERROR)

I installed pgadmin4 (v4.4) package with from official Arch Linux package repository. It worked until the most recent update. Now I am not able to add a new server. In the browser I got the error:
http://127.0.0.1:36699/browser/server_group/children/1 500 (INTERNAL SERVER ERROR)
And from the server log, I got the error:
2019-04-09 21:41:49,900: ERROR flask.app: 'psycopg2.extensions.Column' object has no attribute '_asdict'
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python3.7/site-packages/flask/views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "/usr/lib/pgadmin4/web/pgadmin/browser/utils.py", line 259, in dispatch_request
return method(*args, **kwargs)
File "/usr/lib/pgadmin4/web/pgadmin/browser/utils.py", line 309, in children
children.extend(module.get_nodes(*args, **kwargs))
File "/usr/lib/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py", line 127, in get_nodes
in_recovery, wal_paused = recovery_state(conn, manager.version)
File "/usr/lib/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py", line 52, in recovery_state
status, result = connection.execute_dict(recovery_check_sql)
File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 1202, in execute_dict
desc.to_dict() for desc in cur.ordered_description()
File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 1202, in <listcomp>
desc.to_dict() for desc in cur.ordered_description()
File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/cursor.py", line 94, in to_dict
ores = OrderedDict(self.orig_col._asdict())
AttributeError: 'psycopg2.extensions.Column' object has no attribute '_asdict'
I wonder if whether it is only me because I didn't get anything from google search.
I have the same issue psycopg2 2.8.1. Downgrade to 2.7.7 makes the trick.
pgAdmin4 team has released the new version pgadmin4 (v4.5) which will work with latest version of psycopg2 which is psycopg2 2.8.1
https://www.pgadmin.org/download/
Bug: https://redmine.postgresql.org/issues/4143
In my case, first attempt of execution of command /usr/pgadmin4/bin/setup-web.sh showed below error that caused the web URL to show 500 error.
/usr/pgadmin4/bin/setup-web.sh: line 87: semanage: command not found
I'm using AlamLinux. I installed the required package and ran setup-web.sh again to make the web URL working
yum install policycoreutils-python-utils
/usr/pgadmin4/bin/setup-web.sh

Tensorflow could not initialize the libcurl library on Mac OS

I have build up the WebAPP of this Project on Mac OS using conda and tensorflow v0.12.1. It work so well still I try to train, tensorflow show this error message:
W tensorflow/core/platform/cloud/google_auth_provider.cc:151] All
attempts to get a Google authentication bearer token failed, returning
an empty token. Retrieving token from files failed with "Failed
precondition: Could not initialize the libcurl library. Please make
sure that libcurl is installed in the OS or statically linked to the
TensorFlow binary.". Retrieving token from GCE failed with "Failed
precondition: Could not initialize the libcurl library. Please make
sure that libcurl is installed in the OS or statically linked to the
TensorFlow binary.".
Logs:
2018-04-03 09:33:49,154 - candysorter.views.api - INFO - === Start training: id=9120093671565748, session=20180403_093211_9120093671565748 ===
2018-04-03 09:33:49,154 - candysorter.views.api - INFO - Creating labels file: job_id=candy_sorter_20180403_093211_9120093671565748
2018-04-03 09:33:49,184 - candysorter.views.api - ERROR - Unexpected error.
Traceback (most recent call last):
File "/Users/wubinbin/anaconda3/envs/candy/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/wubinbin/anaconda3/envs/candy/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/wubinbin/Developer/FindYourCandy/webapp/candysorter/views/api.py", line 101, in wrapper
return f(*args, **kwargs)
File "/Users/wubinbin/Developer/FindYourCandy/webapp/candysorter/views/api.py", line 337, in train
candy_trainer.create_labels_file(job_id, labels)
File "/Users/wubinbin/Developer/FindYourCandy/webapp/candysorter/models/images/train.py", line 76, in create_labels_file
f.write(json.dumps(labels, separators=(',', ':')))
File "/Users/wubinbin/anaconda3/envs/candy/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 150, in __exit__
self.close()
File "/Users/wubinbin/anaconda3/envs/candy/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 182, in close
pywrap_tensorflow.Set_TF_Status_from_Status(status, ret_status)
File "/Users/wubinbin/anaconda3/envs/candy/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/wubinbin/anaconda3/envs/candy/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
FailedPreconditionError: Could not initialize the libcurl library. Please make sure that libcurl is installed in the OS or statically linked to the TensorFlow binary.
I use TF1.7.0 instead of TF0.12.1, and fix this problem. But I still don't know what happen in TF0.12.1.

Selenium webdriver.Firefox() is not callable

I hope this is something simple, it feels like it. But it is beyond me at the moment.
I am a new starter with Selenium, I want to automatically extract information from a website and this seems a good method.
For a change I have started doing this on Windows 10 and I want program in Python so I am using PyCharm. I have installed Selenium using pip install selenium and if I use the python command line shell with the following:
from selenium import webdriver
driver = webdriver.Firefox()
I get the following error message:
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from selenium import webdriver
>>> driver = webdriver.Firefox()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 81, in __init__
self.binary, timeout)
File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 51, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 98, in _wait_until_connectable
raise WebDriverException("The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
When I type the same within PyCharm the IDE tells me that this term webdriver.Fiefox results in Firefox is not callable
Have I failed to install something?
>
Not meant as a silly reaction, but do you have the latest version of Firefox installed on your machine?