Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CQ Editor cannot find files in module search path

Open
#439 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Reproduce the import difference between a poetry shell and cq-editor using the project layout and example.py shown in the issue. Inspect how cq-editor selects its Python interpreter and builds sys.path; done means libraries on the active virtual environment's module search path import without the script-level sys.path.append workaround.

Written by the indexing model from the issue text.

Description

Consider a project setup like this:

/
|- pyproject.toml
|- poetry.lock
|- mylib
    |- __init__.py
    |- mystery.py
|- example
    |- example.py

where

# mystery.py

def mystery():
    return Cq.Workplane().box(10, 5, 5)

in a poetry shell environment, this succeeds:

(mylib-3.12) [example/] $ python3 -c "import mylib.mystery"

but if example.py contains any reference to import mylib.mystery, loading it up in cq-editor will fail, unless the script starts with this:

# example.py
import os, sys, os.path

root = os.path.dirname(os.getcwd())
print(root)

sys.path.append(root)

import mylib.mystery

The spooky thing is after this part of the script is loaded into cq-editor, commenting it out would not reintroduce the import error. Is there a way for cq-editor to recognize the current venv so it can load libraries referenced by cad scripts?

Dominant language
Python
Stars
1.3k
Forks
210
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CadQuery/CQ-editor

All issues in CadQuery/CQ-editor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.