Code Monkey home page Code Monkey logo

Comments (2)

daveschaefer avatar daveschaefer commented on June 28, 2024

I believe this is actually an issue with the syntax used for importing. The code just needs to be updated to use a local import.

If I try to import and use this tsheets module, I get an error like:

from tsheets.api import TSheets

File "site-packages/tsheets/init.py", line 1, in
import repos
File "site-packages/repos.py", line 9, in
from fabric.api import local, lcd as cd, task
ModuleNotFoundError: No module named 'fabric.api'

I believe this is because tsheets/init.py should be using a different import syntax.
Instead of
"import repos"
It should be doing:
"from . import repos"

  • i.e. it should import the local module "tsheets.repos". NOT the separate python package 'repos'.[1]

Without the local import specification, python was attempting to import the separate python package 'repos'[1].
If you happened to already have the 'repos' package installed on your system, depending on the version, the python code inside 'repos' started with this code:
"from fabric.api import ..."

This import call inside 'repos' would then attempt to import the 'fabric' package.

Neither 'fabric' nor 'repos' seem to be needed to run this tsheets python module.
It just needs to use a local, relative import, to use its own code.

My patch in #6 should fix this.

[1] https://pypi.org/project/repos/

from api_python.

dustinsweet avatar dustinsweet commented on June 28, 2024

The fix is merged to master. Thanks once again Dave!

from api_python.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.