question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Error with Bayesian

See original GitHub issue

Hello, I’ve been trying to run GA with no success (I’ll make separate post), so I thought I’d try Bayesian, and I’m getting the following error when trying to run python3 japonicus.py -b --strat PPO

The profits reported here are the profit beyond market price change;
	i.e. shown profit =  <backtest profit> - <market profit in evaluated candlestick period>;
Traceback (most recent call last):
  File "japonicus.py", line 102, in <module>
    import evolution_bayes
  File "/home/user/gekko/japonicus/evolution_bayes.py", line 19, in <module>
    import chart
  File "/home/user/gekko/japonicus/chart.py", line 6, in <module>
    import matplotlib.pyplot as plt
  File "/usr/local/lib/python3.6/site-packages/matplotlib/pyplot.py", line 114, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/usr/local/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/usr/local/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
    from matplotlib.externals.six.moves import tkinter as Tk
  File "/usr/local/lib/python3.6/site-packages/matplotlib/externals/six.py", line 90, in __get__
    result = self._resolve()
  File "/usr/local/lib/python3.6/site-packages/matplotlib/externals/six.py", line 113, in _resolve
    return _import_module(self.mod)
  File "/usr/local/lib/python3.6/site-packages/matplotlib/externals/six.py", line 80, in _import_module
    __import__(name)
  File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

Any thoughts would be appreciated, Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
BradT7commented, Jan 27, 2018

I found the solution to my last post! 😄 Using the same method that fixed my GA error (Issue 60). After installing python properly using method you mentioned here Then running the following commands: sudo apt-get install python3.6-tk sudo python3.6 -m pip install python-tk sudo apt-get install python3-tk

Hope this helps any others that may run into this issue!

0reactions
BradT7commented, Jan 25, 2018

Looks like I installed manually as well like this thread, and did not include tk library from what I’m reading, now the journey begins on how to uninstall 3.6.4 and re-install properly with tk included. Anytime I try installing or downloading tk manually from terminal I get errors.

I ran into another issue on another machine I was trying to install everything fresh. I was able to install python in usr/lib using some other install method, but whenever I install or run any pip commands, everything is installed to the 3.5 python folder, for example after running the pip installer, deap is located in the 3.5 folder not 3.6. So I ran into another road block. I can run a python3.6 command, but a pip3.6 is not supported and errors. so pip3 is running from version 3.5. So frustrating.

So maybe the take away is how do I properly install python, or the necessary way for japonicus, and how to I default pip and python to run from version 3.6 when python is installed in usr/lib.

I was able to try and just download but again it installed to my 3.5 folder, and still getting the tk error

$ sudo apt-get install python3-tk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  tix python3-tk-dbg
The following NEW packages will be installed:
  python3-tk
0 upgraded, 1 newly installed, 0 to remove and 16 not upgraded.
Need to get 25.1 kB of archives.
After this operation, 89.1 kB of additional disk space will be used.
Get:1 http://mirror.csclub.uwaterloo.ca/ubuntu xenial/main amd64 python3-tk amd64 3.5.1-1 [25.1 kB]
Fetched 25.1 kB in 0s (330 kB/s)
Selecting previously unselected package python3-tk.
(Reading database ... 202562 files and directories currently installed.)
Preparing to unpack .../python3-tk_3.5.1-1_amd64.deb ...
Unpacking python3-tk (3.5.1-1) ...
Setting up python3-tk (3.5.1-1) ...

Not sure if the way I installed python is also affecting issue 60, but I actually get further results with the GA method.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6.1 Bayesian Measurement Error Model | Stan User's Guide
A Bayesian approach to measurement error can be formulated directly by treating the true quantities being measured as missing data (Clayton 1992; Richardson ......
Read more >
Error Rate Schmerror Rate - Bayesian Spectacles
First, we will show that Bayesian inference does something much better than “controlling error rate”: it provides the probability that you are ...
Read more >
Controlling Type I error in RCTs with interim looks: a Bayesian ...
Type I error rates based on 1000 subjects/10 interim looks ... At both sample size levels, the Bayesian analysis has a slightly lower...
Read more >
Analysis of type I and II error rates of Bayesian and frequentist ...
An extensive simulation study is provided, the results of which demonstrate that the proposed Bayesian tests achieve better type I error ...
Read more >
BAYESIAN METHODS
Bayesian methods and their applications in measurement error problems. ... users do not actually have to do anything but run a program, and....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found