DEV Community

Xianer-quant
Xianer-quant

Posted on

My First Day Learning Quantitative Trading: Installing VnPy on Mac M1

Why I'm Writing This

I'm a recent graduate who decided to learn quantitative trading. This is Day 1 of my learning journey.

The Problem

I tried to install VnPy (a Python trading framework) on my Mac M1. It seemed simple, but...

First attempt:

python3 -c "import vnpy"
Enter fullscreen mode Exit fullscreen mode

Error:

ModuleNotFoundError: No module named 'vnpy.trader'
Enter fullscreen mode Exit fullscreen mode

I asked AI: "What does ModuleNotFoundError mean?" AI gave me answers, but none worked.

The Insight

The problem wasn't AI's answer. The problem was I didn't understand my own problem well enough.

AI can only help if you know what to ask.

The Solution

After debugging, I discovered: Mac had multiple Python versions!

  • python3 → Python 3.9
  • python → Python 3.13 (where VnPy was installed)

When I used the correct command:

python << 'EOF'
from vnpy.trader.engine import MainEngine
print("✅ VnPy installed successfully!")
EOF
Enter fullscreen mode Exit fullscreen mode

Success! ✅

What I Learned

  1. Problem-solving > tool usage
  2. AI is powerful, but you need to be smarter
  3. Keep learning in public

If you're also learning to code or trading,

Top comments (0)