# \#python

**URL:** https://discourse.numenta.org/tag/python/98.md

[Latest](https://discourse.numenta.org/latest.md) · [Categories](https://discourse.numenta.org/categories.md) · [Tags](https://discourse.numenta.org/tags.md)

---

## [Python 3 Migration: TM's not matching](https://discourse.numenta.org/t/python-3-migration-tms-not-matching/3395)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 0\
**Last updated:** [January 31, 2018, 1:31am UTC](https://discourse.numenta.org/t/python-3-migration-tms-not-matching/3395 "2018-01-31T01:31:32Z")

</div>

I’m debugging an issue I have with backtracking\_tm\_cpp2\_test.py. I set the verbosity to 10 and I get the following output. Can someone spot what is going wrong? D:\\nupic\\src\\python\\python3\\tests\\unit\\nupic\\algorithms\>py…

---

## [Python 3 migration](https://discourse.numenta.org/t/python-3-migration/3228)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 48\
**Last updated:** [May 31, 2019, 9:52pm UTC](https://discourse.numenta.org/t/python-3-migration/3228 "2019-05-31T21:52:02Z")

</div>

Happy New Years! In the past few days I have started migrating nupic’s python code base to python 3. I started out with the “2to3” script which worked quite well. The output can be found here. Some of the examples and …

---

## [NuPIC & Python 2 end of life](https://discourse.numenta.org/t/nupic-python-2-end-of-life/5678)

<div class="topic-metadata">

**Author:** [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Replies:** 0\
**Last updated:** [March 26, 2019, 3:37pm UTC](https://discourse.numenta.org/t/nupic-python-2-end-of-life/5678 "2019-03-26T15:37:31Z")

</div>

Since NuPIC 1.0, when Numenta starting focusing entirely on research, we have had NuPIC (Python) and NuPIC Core (C++) in maintenance mode. As I’m sure you’re all aware, NuPIC is largely written in Python 2.7. You may al…

---

## [Python 3 Migration: \_paramTypeCache not found](https://discourse.numenta.org/t/python-3-migration-paramtypecache-not-found/3362)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 7\
**Last updated:** [February 23, 2018, 9:03pm UTC](https://discourse.numenta.org/t/python-3-migration-paramtypecache-not-found/3362 "2018-02-23T21:03:25Z")

</div>

Again working on the core\_encoders\_demo.py and true for many other engine relation python code. I keep getting the error: RuntimeError: Attribute \_paramTypeCache not found I understand that the \_paramTypeCache is send …

---

## [Python 3 Migration: Integer Division](https://discourse.numenta.org/t/python-3-migration-integer-division/3483)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 2\
**Last updated:** [February 21, 2018, 12:31am UTC](https://discourse.numenta.org/t/python-3-migration-integer-division/3483 "2018-02-21T00:31:15Z")

</div>

One of the hardest parts in the migration process is to find incorrect integer divisions in the python 2.7 nupic code. Python 3 behaves differently as nicely described here. Here are two locations in nupic which I neede…

---

## [Python 3 Migration: SP Overlay Test](https://discourse.numenta.org/t/python-3-migration-sp-overlay-test/3458)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 8\
**Last updated:** [February 17, 2018, 1:37am UTC](https://discourse.numenta.org/t/python-3-migration-sp-overlay-test/3458 "2018-02-17T01:37:33Z")

</div>

This test is using a SpatialPooler to generate some data. Here is the call into nupic.core: onCells = numpy.zeros(columnDimensions) spImpl.compute(spInput, True, onCells) spOutput.append(onCells.tolist…

---

## [Python 3 Migration: Backtracking tests](https://discourse.numenta.org/t/python-3-migration-backtracking-tests/3455)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 7\
**Last updated:** [February 15, 2018, 12:54am UTC](https://discourse.numenta.org/t/python-3-migration-backtracking-tests/3455 "2018-02-15T00:54:40Z")

</div>

The good news is that the following tests succeed: backtracking\_tm\_constant\_test.py backtracking\_tm\_cpp.py backtracking\_tm\_test.py The missing test “backtracking\_tm\_cpp2\_test.py” doesn’t work right now and I have a ha…

---

## [Python 3 Migration: SDR Classifier Test](https://discourse.numenta.org/t/python-3-migration-sdr-classifier-test/3456)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 3\
**Last updated:** [February 14, 2018, 5:25pm UTC](https://discourse.numenta.org/t/python-3-migration-sdr-classifier-test/3456 "2018-02-14T17:25:19Z")

</div>

In sdr\_classifier\_test.py there is a test called testComputeCategory. I think this test is working but in python 3 the following line self.assertIsInstance(value, (type(None), bytes)) breaks when the value is “D”. Coul…

---

## [Python 3 Migration: encoder attribute](https://discourse.numenta.org/t/python-3-migration-encoder-attribute/3360)

<div class="topic-metadata">

**Author:** [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Replies:** 2\
**Last updated:** [January 24, 2018, 2:27am UTC](https://discourse.numenta.org/t/python-3-migration-encoder-attribute/3360 "2018-01-24T02:27:09Z")

</div>

I’m working myself through the examples and I’m stuck in core\_encoders\_demo.py. In the function createNetwork() we are creating two regions: # C++ consumptionSensor = network.addRegion('consumptionSensor', 'ScalarS…

---

## [HTM prediction model with good accuracy but low activation levels](https://discourse.numenta.org/t/htm-prediction-model-with-good-accuracy-but-low-activation-levels/3276)

<div class="topic-metadata">

**Author:** [@jclevesque](https://discourse.numenta.org/u/jclevesque)\
**Replies:** 2\
**Last updated:** [January 12, 2018, 7:04pm UTC](https://discourse.numenta.org/t/htm-prediction-model-with-good-accuracy-but-low-activation-levels/3276 "2018-01-12T19:04:13Z")

</div>

I am using an HTMPrediction model on a sequence of inputs, predicting the next steps in the sequence. I am trying to establish a correlation between the activation of my columns and the signal I am modelling (or rather a…

---

## [Making a deep copy of an OPF model](https://discourse.numenta.org/t/making-a-deep-copy-of-an-opf-model/3016)

<div class="topic-metadata">

**Author:** [@bkutt](https://discourse.numenta.org/u/bkutt)\
**Replies:** 9\
**Last updated:** [November 2, 2017, 7:29pm UTC](https://discourse.numenta.org/t/making-a-deep-copy-of-an-opf-model/3016 "2017-11-02T19:29:11Z")

</div>

Hello! I have an instance of an OPF model (the same one used in the numenta detector in NAB, actually) that I’d like to make a deep copy of in my code. The simplest solution (trying “model\_copy = copy.deepcopy(model)”) …

---

## [AttributeError with model.save related to TMCPPShim object](https://discourse.numenta.org/t/attributeerror-with-model-save-related-to-tmcppshim-object/2434)

<div class="topic-metadata">

**Author:** [@Jody\_Schechter](https://discourse.numenta.org/u/Jody_Schechter)\
**Replies:** 6\
**Last updated:** [June 19, 2017, 8:30pm UTC](https://discourse.numenta.org/t/attributeerror-with-model-save-related-to-tmcppshim-object/2434 "2017-06-19T20:30:04Z")

</div>

Hello, I'm new to Nupic, and today I ran into a problem saving a model. My code is simple: model = createModel() model.enableInference({"predictedField": "cpu1"}) model.save(fullpath) "fullpath" refers to the full …

---

## [Pip uninstall nupic pycapnp artifact](https://discourse.numenta.org/t/pip-uninstall-nupic-pycapnp-artifact/2432)

<div class="topic-metadata">

**Author:** [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Replies:** 3\
**Last updated:** [June 19, 2017, 6:56pm UTC](https://discourse.numenta.org/t/pip-uninstall-nupic-pycapnp-artifact/2432 "2017-06-19T18:56:58Z")

</div>

Maybe there are some seasoned python users who can help me out with this problem… I can run pip install nupic --user and then pip uninstall nupic -y without problems, but if I run pip uninstall nupic -y any more times, …

---

## [Python Style Guide](https://discourse.numenta.org/t/python-style-guide/2128)

<div class="topic-metadata">

**Author:** [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Replies:** 0\
**Last updated:** [April 6, 2017, 5:30pm UTC](https://discourse.numenta.org/t/python-style-guide/2128 "2017-04-06T17:30:45Z")

</div>

Moved to API docs: http://nupic.docs.numenta.org/0.7.0.dev0/contributing/python-style-guide.html
