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

Windows, init-db error #16

Closed
ghost opened this issue Jul 2, 2020 · 2 comments
Closed

Windows, init-db error #16

ghost opened this issue Jul 2, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2020

Python 3.8
Log:
(discord-bot) C:\Users\niksonbinsk\PycharmProjects\discord-bot>aerich init-db
c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\box\box.py:928: BoxWarning: msgpack is not found in the environment. to_msgpack and from_msgpack transforms will not work
warnings.warn(
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\niksonbinsk.virtualenvs\discord-bot-cMd0c8iy\Scripts\aerich.exe_main
.py", line 7, in
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\cli.py", line 231, in main
cli(_anyio_backend="asyncio")
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 799, in call
return anyio.run(self._main, main, args, kwargs, backend=anyio_backend)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_init
.py", line 68, in run
return asynclib.run(func, *args, **backend_options) # type: ignore
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_backends_asyncio.py", line 99, in run
raise exception
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_backends_asyncio.py", line 67, in wrapper
retval = await func(*args)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 802, in _main
return await main(*args, **kwargs)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 748, in main
rv = await self.invoke(ctx)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 1175, in invoke
return await _process_result(await sub_ctx.command.invoke(sub_ctx))
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 994, in invoke
return await ctx.invoke(self.callback, **ctx.params)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 588, in invoke
rv = await rv
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\cli.py", line 206, in init_db
os.mkdir(dirname)
FileNotFoundError: [WinError 3] Системе не удается найти указанный путь: 'migrations\models'

(discord-bot) C:\Users\niksonbinsk\PycharmProjects\discord-bot>aerich init-db
c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\box\box.py:928: BoxWarning: msgpack is not found in the environment. to_msgpack and from_msgpack transforms will not work
warnings.warn(
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\niksonbinsk.virtualenvs\discord-bot-cMd0c8iy\Scripts\aerich.exe_main
.py", line 7, in
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\cli.py", line 231, in main
cli(_anyio_backend="asyncio")
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 799, in call
return anyio.run(self._main, main, args, kwargs, backend=anyio_backend)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_init
.py", line 68, in run
return asynclib.run(func, *args, **backend_options) # type: ignore
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_backends_asyncio.py", line 99, in run
raise exception
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_backends_asyncio.py", line 67, in wrapper
retval = await func(*args)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 802, in _main
return await main(*args, **kwargs)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 748, in main
rv = await self.invoke(ctx)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 1175, in invoke
return await _process_result(await sub_ctx.command.invoke(sub_ctx))
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 994, in invoke
return await ctx.invoke(self.callback, **ctx.params)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 588, in invoke
rv = await rv
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\cli.py", line 206, in init_db
os.mkdir(dirname)
FileNotFoundError: [WinError 3] Системе не удается найти указанный путь: './migrations\models'

(discord-bot) C:\Users\niksonbinsk\PycharmProjects\discord-bot>aerich init -t models.config
Success create migrate location ./migrations
Success generate config file aerich.ini

(discord-bot) C:\Users\niksonbinsk\PycharmProjects\discord-bot>aerich init-db
c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\box\box.py:928: BoxWarning: msgpack is not found in the environment. to_msgpack and from_msgpack transforms will not work
warnings.warn(
Success create app migrate location ./migrations\models
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\niksonbinsk.virtualenvs\discord-bot-cMd0c8iy\Scripts\aerich.exe_main
.py", line 7, in
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\cli.py", line 231, in main
cli(_anyio_backend="asyncio")
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 799, in call
return anyio.run(self._main, main, args, kwargs, backend=anyio_backend)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_init
.py", line 68, in run
return asynclib.run(func, *args, **backend_options) # type: ignore
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_backends_asyncio.py", line 99, in run
raise exception
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\anyio_backends_asyncio.py", line 67, in wrapper
retval = await func(*args)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 802, in _main
return await main(*args, **kwargs)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 748, in main
rv = await self.invoke(ctx)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 1175, in invoke
return await _process_result(await sub_ctx.command.invoke(sub_ctx))
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 994, in invoke
return await ctx.invoke(self.callback, **ctx.params)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\asyncclick\core.py", line 588, in invoke
rv = await rv
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\cli.py", line 211, in init_db
Migrate.write_old_models(config, app, location)
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\migrate.py", line 198, in write_old_models
cls.cp_models(app, old_model_files, os.path.join(location, app, cls.get_old_model_file()))
File "c:\users\niksonbinsk.virtualenvs\discord-bot-cmd0c8iy\lib\site-packages\aerich\migrate.py", line 158, in cp_models
content = f.read()
File "c:\program files\python38\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 844: character maps to

aerich.ini:

[aerich]
tortoise_orm = models.config
location = ./migrations
`

@ghost ghost changed the title Windows, Migrate error Windows, init-db error Jul 2, 2020
@long2ice
Copy link
Member

long2ice commented Jul 2, 2020

Maybe you should install msgpack first.

@ghost
Copy link
Author

ghost commented Jul 2, 2020

Fixed with 0.2.1 update

@ghost ghost closed this as completed Jul 2, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant