question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] - Installing with pip adds a global 'tests' package

See original GitHub issue

Describe the bug When I install the package with pip

pip install TikTokApi

A tests module appears in site-packages. This isn’t a problem on it’s own, but it’s pretty common to name the test directory ‘tests’ in python projects. If you have a helper module in there (e.g. your_project/tests/helpers.py) then you can no longer import anything from that tests directory, as site-packages takes precedence over pythonpath.

The buggy code

# myproject/tests/test_something.py
from tests.helpers import some_helper

ModuleNotFoundError: No module named ‘tests.helpers’

Expected behavior

I expect to be able to name my tests module ‘tests’

Desktop (please complete the following information):

  • OS: MacOS 10.14.6 Mojave
  • TikTokApi Version: 3.4.3
  • Python: 3.8.3

Additional context

Just renaming that to TikTokApi-tests would work great.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
issue-label-bot[bot]commented, Aug 19, 2020

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

0reactions
hoylemdcommented, Aug 19, 2020

As a workaround, things seem to work fine if you just delete that tests package from site-packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip installing in global site-packages instead of virtualenv
to fix this issue just run virtualenv with extra parameter —no-site-packages it will create that file and when you activate the environment it ......
Read more >
[BUG] latest setuptools release (60.3.0) broke pip? · Issue #3002
Expected behavior. Pip continues to work after installing the latest release of setuptools, rather than raising AttributeError. How to Reproduce.
Read more >
Using Python's pip to Manage Your Projects' Dependencies
You can add as many packages as you want to the pip install command. ... pip.conf [global] index-url = https://test.pypi.org/simple/.
Read more >
pip install - pip documentation v22.3.1
Description#. Install packages from: PyPI (and other indexes) using requirement specifiers. VCS project urls. Local project directories.
Read more >
Managing Python packages the right way - Opensource.com
pip is the de facto package manager in the Python world. It can install packages from many sources, but PyPI is the primary...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found