Clojure and Spec on Heroku: "Unable to resolve symbol: bigdec?" - clojure

I'm trying to run a Clojure uberjar on Heroku that uses Spec, but it throws:
2018-03-15T09:57:33.361093+00:00 app[web.1]: at clojure.lang.Var.invoke(Var.java:381)
2018-03-15T09:57:33.361140+00:00 app[web.1]: at clojure.lang.RT.doInit(RT.java:487)
2018-03-15T09:57:33.361173+00:00 app[web.1]: at clojure.lang.RT.(RT.java:336)
2018-03-15T09:57:33.361282+00:00 app[web.1]: at clojure.main.(main.java:20)
2018-03-15T09:57:33.361572+00:00 app[web.1]: Caused by: java.lang.RuntimeException: Unable to resolve symbol: bigdec? in this context, compiling:(clojure/spec/gen/alpha.clj:132:4)
I think this is related to the alpha-ness of Spec, but I don't know which versions I'm supposed to bump.

bigdec? was removed before 1.9 got released:
https://dev.clojure.org/jira/browse/CLJ-2259
Are you using an older version of Spec together with clojure 1.9 proper?

Related

Problem when downloading Google CRMint: AttributeError: module 'appcli' has no attribute 'entry_point'

I am trying to install CRMint following these instructions: https://google.github.io/crmint/docs/quickstart/cloudshell.md
When I tried to run to check if I have installed it
crmint --help
The following error appeared
Traceback (most recent call last):
File "/home/user/crmint/.venv/bin/crmint", line 33, in <module>
sys.exit(load_entry_point('crmint', 'console_scripts', 'crmint')())
File "/home/user/crmint/.venv/bin/crmint", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 79, in load
return functools.reduce(getattr, attrs, module)
AttributeError: module 'appcli' has no attribute 'entry_point'
Could someone help me on that? Thank you in advance.
I tried uninstalling and installing 'appcli', but it still didn't work.
This was around the same time that CRMint was upgraded to it's newest architecture, CRMint 3.0. This was a temporary bug that was impacting deployment, however, the current architecture deployment has been tested and should be working quiet reliably.
Sorry for the inconvenience. Let me know if you have other questions!

Django: "django.contrib.gis.gdal.prototypes.ds" crashes with "attributeerror: symbol not found"

Running the latest Django (3.0.4) I am now getting this:
File "[...]site-packages/django/contrib/gis/gdal/driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "[...]site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 71, in <module>
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x101667060, OGR_F_GetFieldAsInteger64): symbol not found
My Observations:
I have [ellided] the path names which refer to Django in my virtual-environment. I observe that the module that is actually crashing is in /Library/Frameworks/Python.framework/ ... this on Macintosh OS/X Catalina.
The version of Python that is installed on this computer is 3.6.4. (The version on the hosting service is considerably older ... 3.4.)
Is this, as I suspect, a problem with the Python installation on this computer? (The most recent version that can be installed here is 3.7.7.)
EDIT: NO, it isn't!
After installing Django 3.0.4 on a Linux host I got this:
AttributeError: /usr/local/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64
Now, once again this is a system-wide library that's being called, but I now suspect that the root cause problem is actually in this line:
File "[...]/lib/python3.6/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 71, in <module>
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
I am now rolling Django versions backward to see if I can make the problem go away and if so "answer my own question."
I had to walk back all the way to Django 2.1 before the problem finally went away.
libgdal version 1.6 is installed on this computer's virtual-environment and I don't know if it is practical nor possible for me to change it. ("gcc" is installed here, "configure" is not.)

not able to build git hub project on ubuntu system, getting os error host alias not in environment

I have one Github project, I cloned it locally using pycharm IDE and installed all the packages to run the project successfully. When I try to build the solution, getting the exception as host alias is not in environment.
below is the exception detail.
`Unhandled exception in thread started by <function fn at 0x7fa22ef08e60>
Traceback (most recent call last):
File "./runner.py", line 20, in fn
subprocess.call(command.split(" "), cwd = directory)
File "/usr/lib/python2.7/subprocess.py", line 523, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
BUILD_NUMBER: 1390
FATAL ERROR: FEED_HOST_ALIAS not in environment
BUILD_NUMBER: 1390
FATAL ERROR: FEED_HOST_ALIAS not in environment
BUILD_NUMBER: 1390
FATAL ERROR: FEED_HOST_ALIAS not in environment`
OS version: Ubuntu 16.04 LTS
Python version: 2.7.10
Let's sort things out.
this is problem running the application. You don't "build" python applications
this seems to be a multithreaded application. Therefore there may be output from different threads.
in line 20 of your file ./runner.py you call subprocess.call().
that call internally calls some other things (Popen() and _execute_child()), but the final action is to raise an exception telling you No such file or directory.
since the subproces.call() call ends at that point, it is likely that the other output is from another thread. You could search your solution for the string 'FEED_HOST_ALIAS', but my guess is that this message is not directly related to the problem.
The problem is, as subprocess.call() reports, that the file you are asking to run does not exist. So set a breakpoint in runner.py at line 20 and have a look at what is passed as parameters. Then you should find out what happens. PyCharm lets you step into calls, so you might even want to check what happens inside subprocess.call() - or place a breakpoint somewhere within subprocess.py.

Running Tensorflow example for RNNs

I'm trying to run a code as described here.
I have a anaconda enviroment with tensorflow installed via pip installation.
When trying to run the example on the link provided I have a issue. The first one was that the file:ptb_word_lm.py wasn't present on my installation. I just copied the file from github and tried to run anyway. I got the following error when running python ptb_word_lm.py --data_path=/tmp/simple-examples/data/ --model small
error message:
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] Couldn't open CUDA library libcudnn.so. LD_LIBRARY_PATH: /lib/x86_64-linux-gnu:/home/danielmoreira/anaconda2:/home/danielmoreira/anaconda2/lib:/usr/local/cuda-7.5/lib64:
I tensorflow/stream_executor/cuda/cuda_dnn.cc:3448] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "ptb_word_lm.py", line 361, in <module>
tf.app.run()
File "/home/danielmoreira/anaconda2/envs/tensorenv/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "ptb_word_lm.py", line 321, in main
train_input = PTBInput(config=config, data=train_data, name="TrainInput")
File "ptb_word_lm.py", line 85, in __init__
self.input_data, self.targets = reader.ptb_producer(
AttributeError: 'module' object has no attribute 'ptb_producer'
I have found people on google suggesting to change the line from tensorflow.models.rnn.ptb import reader to just import reader, but it doesn't seem to work for me.
Does anyone know the possible solution?
I'm using Python 2.7.12 and Tensorflow version seems to be 0.11.0rc2

psiTurk: AttributeError: 'Process' object has no attribute 'get_connections'

Before I begin, let me give the disclaimer that I'm very new at this sort of thing, that my explanation may not be too coherent, and I have no ability to separate what might and might not be important.
I'd like to run psiTurk. But because psiturk doesn't work on Windows, I'm using Openshift to run Python, with psiturk inside of that. I've gotten Openshift working using PuTTY, and have gotten as far as launching the psiTurk shell. But even when I enter the command to turn the server on, the server remains off with the following error message.
[psiTurk server:off mode:sdbx #HITs:0]$ server on
Experiment server launching...
Now serving on myurl.rhcloud.com
Traceback (most recent call last):
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/cmd2.py", line 789, in onecmd_plus_hooks
stop = self.postcmd(stop, statement)
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/psiturk/psiturk_shell.py", line 205, in postcmd
self.color_prompt()
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/psiturk/psiturk_shell.py", line 571, in color_prompt
server_status = self.server.is_server_running()
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/psiturk/experiment_server_controller.py", line 144, in is_server_running
psiturk_exp_ports = [process[0].laddr[1] for process in [psutil.Process(int(pid)).get_connections() for pid in output]]
AttributeError: 'Process' object has no attribute 'get_connections'
'Process' object has no attribute 'get_connections'
Any help would be much appreciated.
Seems like standard pip install psiturk installs a version of the psutil library that's not compatible with psiturk. What worked for me was installing directly from git:
pip install git+git://github.com/NYUCCL/psiTurk.git#master
See this PR for details: https://github.com/NYUCCL/psiTurk/pull/192
Also, it's best to make a virtualenv to avoid problems with already-installed packages.