Problem: nothing provides requested backtrader

I am VERY new to all of this, so if this isn’t the right place to post a question of this nature, feel free to point me in the right direction. I have installed the full version of Anaconda versus just the miniconda version. I have taken a copy of the code from GitHub and unzipped it into a folder at N:\Python\ML4T.

I first tried this command:

conda env create -f installation/ml4t-base.yml

but it returned:

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:
- backtrader

The environment was not created, so then I tried:

conda create -n ml4t python=3.8
mamba env update -n ml4t -f installartion/ml4t-base.yml

That finished with:

Encountered problems while solving.
Problem: nothing provides requested backtrader

The good news is that the environment was created fine. I have spent some time earlier fiddling with backtrader and I was starting to see some people question whether it was currently being supported.

I guess my question at this point is: Do I have enough to continue looking at exercises in the book that involve areas not related to backtrader? Or, is there a way to fix things so that backtrader is no longer a problem?

Not the best answer to your question but I’ve found it easiest to use the Docker images even though I don’t think it’s the recommended path. It will teach you the essentials so you can keep moving forward.

I do have Docker installed on the target machine, so I could go that route. I also read that this is no longer the recommended way, so I was trying hard to keep with the latest and greatest methods. I have just seen so many things about backtrader being marked as “complete” and no longer developed/maintained, that I suspected that there was a problem with the build because it includes that library/module.

Thank you for your reply, I’m eager to get going on the backtesting portion.

I have a different problem now. I went back and started over and saw that this statement was causing me some problems:

conda env create -n ml4t python=3.8

When I finally figured out that it needs to be:

conda create -n ml4t python=3.8

Then I went ahead and did the Windows specific installation:

mamba env update -n ml4t -f installation/windows/ml4t.yml

That ran for a while then ended in an error:

WARNING: Discarding https://files.pythonhosted.org/packages/1a/72/33be87cce255d4e9dbbfef547e9fd6ec7ee94d0d0910bb2b13badea3fbbe/scs-2.1.2.tar.gz#sha256=667ed6019bb4e2f925bd9291161d2c61cc0077443094437b703ea905333fd585 (from Links for scs). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement scs==2.1.2 (from versions: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.0.6, 1.0.7, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.7, 1.2.1, 1.2.2, 1.2.3, 1.2.5, 1.2.6, 1.2.7, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.1.post2, 2.1.2, 2.1.3, 2.1.4)
ERROR: No matching distribution found for scs==2.1.2

And this I was able to resolve by moving the scs==2.1.2 line from the - pip: section to the :dependencies section in ml4t.yml. Maybe my version of pip isn’t up to the task, but I got a successful EOJ and it looks ok so far.

Just in case this helps someone else, the answer for me anyway, was to simply follow the instructions to the letter. For whatever reason, even though I thought they were the same or equivalent, I had success right away when I uninstalled Anaconda and then installed miniconda. I should’ve known better than to try and improvise, but everything I read said that Anaconda would be fine, just takes up more disk space, but I definitely don’t need it, so miniconda worked just fine.

Sorry for being late to the discussion, genuinely really sorry. I had the same experience having already had anaconda installed and was getting all sorts of issues… Finally had a “screw it” moment and uninstalled everything and when I followed the instructions word for word, I had no issues.

I have also given up on doing this in google colab… that is another level of headache if you don’t do this everyday. Was spending more time debugging than running the example software.

I switched to a Colab hybrid setup. I ran some stuff in Colab and just shared files across my platform. I run some stuff on Colab other things in intellij

I finally just gave up. Hours and hours of wasted time and I began to see that my priorities needed to shift over to doing more of an entire portfolio view of my IRA account. I appreciate your suggestion about Colab, it looks promising for using the book’s Jupyter Notebooks. I might like to do some of the web crawling exercises in the book to try and tap into non-traditional data sources. Or I might just learn to code in Pine and use the TradingView platform? I really wanted to try and figure out machine learning, but I’m just too sl-o-o-o-o-ow, lol…

Also just looked up Intellij and see it’s from Jetbrains. I prefer PyCharm over Visual Studio Code, so maybe there’s some promise there too. At any rate, thank you again for sharing your experience!