Fenixin/Minecraft-Region-Fixer

Unable to run RegionFixer (ImportError: cannot import name 'world')

Closed this issue · 20 comments

I'm not able to run RegionFixer. It gives me this error message:

Traceback (most recent call last):
  File "regionfixer.py", line 29, in <module>
    from regionfixer_core import world
  File "/root/WN/AidansPrivateMinecraftServer/Minecraft-Region-Fixer/regionfixer_core/world.py", line 26, in <module>
    from .util import table
  File "/root/WN/AidansPrivateMinecraftServer/Minecraft-Region-Fixer/regionfixer_core/util.py", line 27, in <module>
    from . import world
ImportError: cannot import name 'world'

While running any command linked to RegionFixer, even the basic python regionfixer.py --help. The command I need to run is python regionfixer.py /root/WN/AidansPrivateMinecraftServer/Creative/region/*.msa (I really hope that I am inputting the file path correctly, I tried many different ways to input it).

I tried running the commands with both python and python3.

  • OS: Linux (Debian)
  • Python version: 2.7.9 and 3.4.2
  • Region Fixer Version: 0.3.2

If you need any additional info, please tell me. Thanks in advance.

Hello!

Could you please make sure that you are using python 3.x? RegionFixer only works with python 3.x, and it will throw out that error if you try to run it with python 2.x. Please, try running python --version and report the result?

I already tried running commands using python3, which is essentially Python 3.4.2 and it still would not work.
Here's a screenshot of that:
image

How have you downloaded RegionFixer? Have you tried to download the master branch?

I am pretty sure I downloaded the master branch (I hope running git clone https://github.com/Fenixin/Minecraft-Region-Fixer.git is downloading the master branch)

Well you got me, I have no idea what is going on. I really don't. I have 2 computer in home with linux and windows and in both works without a problem. An observation, you have to run regionfixer, the other files are not meant to be run directly.

An idea: Could it be that you are running it as root and something strange is happening?

I cannot get my hardware admin to create a user, and he says that it shouldn't affect anything. I tried doing the same commands on Windows today, half of the times it gave me a "insufficient permissions" error, the other half of the times - 2 blank lines, I tried inputting the file path with the quotes and without them, running it in Git CMD and normal Windows CMD, running it with and without admin permissions. I also have Python 3.7 installed there.

Well, let's some random stuff. This should not be a problem in linux but could you try to simpliy the directory where regionfixer is stored? maybe moving it to a less deep directory and with smaller names.

You are not the first person that happens to find this problem but my biggest issue getting to the source of the problem is that I can never reproduce this error and I don't have any idea what's going on. Those files are there and can be imported.

Can you run any other python script without problem?

  1. Tried moving it to a less deep directory - still gives me the same error.
  2. Tried running a simple "Hello World" script - works just fine.

How exactly can I git clone a branch? Tried doing git clone -b formatting-typo-python3 https://github.com/grebsai/Minecraft-Region-Fixer/, and it gave me the same error.

You cloned it right, so it doesn't work.

Well, more random ideas: Have you tried restarting you system? If that is not possible, logging in and out?

Ok, this might be happening because I have a circular dependency. But then again I don't know why it works in other systems? I'm going to bed soon and the next days are going to be very busy but I will try to give this a look.

I restarted my Windows system once today, tried on both occasions - doesn't work. A scheduled reboot happened today at ~4 PM on my Linux machine - still does not work. I have tried restarting my SSH sessions multiple times - still does not work.

Okay. I'll be waiting for an update.

It was easier than expected, this branch should fix this issue, please confirm if that is the case:
https://github.com/Fenixin/Minecraft-Region-Fixer/tree/circular-fix

Edit: typo

Yes! It now works properly. Thank you very very very much for helping me solve this issue!

Thank you for answering so fast! This issue has been here for a long time, and now is solved!

Do you have like a PayPal or something so I can donate as an appreciation token?

Paypal account: fenixin at gmail dot com

Thanks again!