Python packages, how to send json files

Asked

Viewed 35 times

0

Hello! The title seems a little contradictory, but the following is happening, I’m making a library in python 3.8 and using the following way to install it:

pip install git+link_do_rep_do_meu_projeto

Until then beauty, but for some functions of my package it is necessary to open a json file, in the directory on github is like this:

pacote
      |__init__.py
      |módulo_com_as_funções.py
      |arquivo.json

Then I ran the Pip command, installed everything, but when I create a file to test if everything is okay, it gives the following error:

AttributeError: partially initialized module 'modulo' has no attribute 'function_name' (most likely due to a circular import)

As if that wasn’t enough, I went to look for the folder Pip had installed the package, I went to test there to see what was happening and, eventually, it has no connection with the circular import, but the json file was not there! If anyone knows how to get Pip to download the json file together, I’ll be very grateful! Any clarification on the Attributeerror will also be welcome! But the question itself is about how to put this json together! Thanks in advance!

  • You can’t answer without knowing the content of __init__.py and of módulo_com_as_funções.py

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.