Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kedro ipython PYTHONPATH #1183

Closed
eepgwde opened this issue Jan 27, 2022 · 3 comments · Fixed by #1188
Closed

kedro ipython PYTHONPATH #1183

eepgwde opened this issue Jan 27, 2022 · 3 comments · Fixed by #1188
Labels
Issue: Bug Report 🐞 Bug that needs to be fixed

Comments

@eepgwde
Copy link

eepgwde commented Jan 27, 2022

Description

Windows path separator

Context

I was looking at why my PYTHONPATH changes would not go through.
It didn't cause a problem, I thought it might!

Steps to Reproduce

  1. I don't know how this code is triggered but

    def _add_src_to_path(source_dir: Path, project_path: Path) -> None:
    _validate_source_path(source_dir, project_path)

    if str(source_dir) not in sys.path:
    sys.path.insert(0, str(source_dir))

    python_path = os.getenv("PYTHONPATH") or ""
    if str(source_dir) not in python_path:
    sep = ";" if python_path else ""
    os.environ["PYTHONPATH"] = f"{str(source_dir)}{sep}{python_path}"

Expected Result

You should use os.pathsep in place of ';'

Actual Result

Tell us what happens instead.

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

Name: kedro
Version: 0.17.4
Summary: Kedro helps you build production-ready data and analytics pipelines
Home-page: https://github.com/quantumblacklabs/kedro
Author: QuantumBlack Labs
Author-email:
License: Apache Software License (Apache 2.0)
Location: /home/share/conda/envs/vega/lib/python3.8/site-packages
Requires: jmespath, jupyter-client, gitpython, toml, cachetools, cookiecutter, fsspec, pip-tools, python-json-logger, dynaconf, anyconfig, click, PyYAML, pluggy, toposort, setuptools
Required-by: kedro-viz, kedro-telemetry

Python 3.8.12

NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
cat: /etc/prelink.conf.d: Is a directory
Amazon Linux release 2 (Karoo)

uname -r -o
4.14.256-197.484.amzn2.x86_64 GNU/Linux

@eepgwde eepgwde added the Issue: Bug Report 🐞 Bug that needs to be fixed label Jan 27, 2022
@antonymilne
Copy link
Contributor

antonymilne commented Jan 28, 2022

Hi @eepgwde, thanks very much for this. Please could you clarify whether it's actually something that is causing a problem? I do see from the os.pathsep documentation that os.pathsep looks more suitable than ;. But is this actually causing you any problems at the moment?

@eepgwde
Copy link
Author

eepgwde commented Jan 31, 2022 via email

@antonymilne
Copy link
Contributor

Hi @eepgwde, thanks very much for this. I've put a fix in for it (#1188) which will be released with 0.17.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Bug Report 🐞 Bug that needs to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants