briefcase: Tutorial 0: WinError 267 The directory name is invalid
Hello!
I’m trying follow the Tutorial 0 on a Windows 10 (one the VirtualBox images) and I am having a real hard time to get it to build.
I have installed the WiX toolset and have enabled the .NET 3.5 framework as well.
I have git
installed and I’m running all the commands through the Git Bash that is installed with it:
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial/helloworld
$ git --version
git version 2.19.1.windows.1
Here is the logs from when I try to run the steps from the tutorial:
IEUser@MSEDGEWIN10 MINGW64 ~
$ python --version
Python 3.6.7
IEUser@MSEDGEWIN10 MINGW64 ~
$ cd tutorial/
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ rm -rf venv
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ python -m venv venv
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ . venv/Scripts/activate
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ pip install briefcase
Collecting briefcase
Using cached https://files.pythonhosted.org/packages/86/42/0326cc6d4d33b2c9392c5f14c234a12aaa71c23dddfacb66b928916a6561/briefcase-0.2.8-py3-none-any.whl
Collecting voc>=0.1.1 (from briefcase)
Using cached https://files.pythonhosted.org/packages/eb/ca/e672edd53ac9bfd60d6c4c2ca81b33b2f3ac5a6b79156dfafbe0d42c0a9b/voc-0.1.6-py3-none-any.whl
Collecting requests<3.0 (from briefcase)
Using cached https://files.pythonhosted.org/packages/ff/17/5cbb026005115301a8fb2f9b0e3e8d32313142fe8b617070e7baad20554f/requests-2.20.1-py2.py3-none-any.whl
Requirement already satisfied: boto3>=1.4.4 in c:\users\ieuser\tutorial\venv\lib\site-packages (from briefcase) (1.9.48)
Collecting setuptools>=40.0 (from briefcase)
Using cached https://files.pythonhosted.org/packages/e7/16/da8cb8046149d50940c6110310983abb359bbb8cbc3539e6bef95c29428a/setuptools-40.6.2-py2.py3-none-any.whl
Collecting cookiecutter>=1.0 (from briefcase)
Using cached https://files.pythonhosted.org/packages/16/99/1ca3a75978270288354f419e9166666801cf7e7d8df984de44a7d5d8b8d0/cookiecutter-1.6.0-py2.py3-none-any.whl
Requirement already satisfied: urllib3<1.24 in c:\users\ieuser\tutorial\venv\lib\site-packages (from briefcase) (1.23)
Requirement already satisfied: pip>=18.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from briefcase) (18.1)
Collecting idna<2.8,>=2.5 (from requests<3.0->briefcase)
Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests<3.0->briefcase)
Using cached https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests<3.0->briefcase)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in c:\users\ieuser\tutorial\venv\lib\site-packages (from boto3>=1.4.4->briefcase) (0.1.13)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in c:\users\ieuser\tutorial\venv\lib\site-packages (from boto3>=1.4.4->briefcase) (0.9.3)
Requirement already satisfied: botocore<1.13.0,>=1.12.48 in c:\users\ieuser\tutorial\venv\lib\site-packages (from boto3>=1.4.4->briefcase) (1.12.48)
Collecting click>=5.0 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting jinja2>=2.7 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting poyo>=0.1.0 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/e0/16/e00e3001007a5e416ca6a51def6f9e4be6a774bf1c8486d20466f834d113/poyo-0.4.2-py2.py3-none-any.whl
Collecting whichcraft>=0.4.0 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/ab/c6/eb4d1dfbb68168bb01c4394420e5e71d5851e64b910838aa0f14ebd5c7a0/whichcraft-0.5.2-py2.py3-none-any.whl
Collecting future>=0.15.2 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz
Collecting jinja2-time>=0.1.0 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl
Collecting binaryornot>=0.2.0 (from cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl
Requirement already satisfied: docutils>=0.10 in c:\users\ieuser\tutorial\venv\lib\site-packages (from botocore<1.13.0,>=1.12.48->boto3>=1.4.4->briefcase) (0.14)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in c:\users\ieuser\tutorial\venv\lib\site-packages (from botocore<1.13.0,>=1.12.48->boto3>=1.4.4->briefcase) (2.7.5)
Collecting MarkupSafe>=0.23 (from jinja2>=2.7->cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/9d/80/9a5daf3ed7b8482e72ee138cef602b538cfba5c507e24e39fb95c189b16b/MarkupSafe-1.1.0-cp36-cp36m-win_amd64.whl
Collecting arrow (from jinja2-time>=0.1.0->cookiecutter>=1.0->briefcase)
Using cached https://files.pythonhosted.org/packages/e0/86/4eb5228a43042e9a80fe8c84093a8a36f5db34a3767ebd5e1e7729864e7b/arrow-0.12.1.tar.gz
Requirement already satisfied: six>=1.5 in c:\users\ieuser\tutorial\venv\lib\site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore<1.13.0,>=1.12.48->boto3>=1.4.4->briefcase) (1.11.0)
Installing collected packages: voc, idna, certifi, chardet, requests, setuptools, click, MarkupSafe, jinja2, poyo, whichcraft, future, arrow, jinja2-time, binaryornot, cookiecutter, briefcase
Found existing installation: setuptools 39.0.1
Uninstalling setuptools-39.0.1:
Successfully uninstalled setuptools-39.0.1
Running setup.py install for future: started
Running setup.py install for future: finished with status 'done'
Running setup.py install for arrow: started
Running setup.py install for arrow: finished with status 'done'
Successfully installed MarkupSafe-1.1.0 arrow-0.12.1 binaryornot-0.4.4 briefcase-0.2.8 certifi-2018.10.15 chardet-3.0.4 click-7.0 cookiecutter-1.6.0 future-0.17.1 idna-2.7 jinja2-2.10 jinja2-time-0.2.0 poyo-0.4.2 requests-2.20.1 setuptools-40.6.2 voc-0.1.6 whichcraft-0.5.2
(venv)
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ pip install cookiecutter
Requirement already satisfied: cookiecutter in c:\users\ieuser\tutorial\venv\lib\site-packages (1.6.0)
Requirement already satisfied: whichcraft>=0.4.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (0.5.2)
Requirement already satisfied: poyo>=0.1.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (0.4.2)
Requirement already satisfied: click>=5.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (7.0)
Requirement already satisfied: jinja2>=2.7 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (2.10)
Requirement already satisfied: binaryornot>=0.2.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (0.4.4)
Requirement already satisfied: jinja2-time>=0.1.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (0.2.0)
Requirement already satisfied: requests>=2.18.0 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (2.20.1)
Requirement already satisfied: future>=0.15.2 in c:\users\ieuser\tutorial\venv\lib\site-packages (from cookiecutter) (0.17.1)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\ieuser\tutorial\venv\lib\site-packages (from jinja2>=2.7->cookiecutter) (1.1.0)
Requirement already satisfied: chardet>=3.0.2 in c:\users\ieuser\tutorial\venv\lib\site-packages (from binaryornot>=0.2.0->cookiecutter) (3.0.4)
Requirement already satisfied: arrow in c:\users\ieuser\tutorial\venv\lib\site-packages (from jinja2-time>=0.1.0->cookiecutter) (0.12.1)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:\users\ieuser\tutorial\venv\lib\site-packages (from requests>=2.18.0->cookiecutter) (1.23)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\ieuser\tutorial\venv\lib\site-packages (from requests>=2.18.0->cookiecutter) (2018.10.15)
Requirement already satisfied: idna<2.8,>=2.5 in c:\users\ieuser\tutorial\venv\lib\site-packages (from requests>=2.18.0->cookiecutter) (2.7)
Requirement already satisfied: python-dateutil in c:\users\ieuser\tutorial\venv\lib\site-packages (from arrow->jinja2-time>=0.1.0->cookiecutter) (2.7.5)
Requirement already satisfied: six>=1.5 in c:\users\ieuser\tutorial\venv\lib\site-packages (from python-dateutil->arrow->jinja2-time>=0.1.0->cookiecutter) (1.11.0)
(venv)
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ cookiecutter https://github.com/pybee/briefcase-template
You've downloaded C:\Users\IEUser\.cookiecutters\briefcase-template before. Is it okay to delete and re-download it? [yes]: yes
app_name [appname]: helloworld
formal_name [App Name]: Hello World
description [An app that does lots of stuff]:
author [Jane Developer]:
author_email [jane@example.com]:
bundle [com.example]:
Select license:
1 - BSD license
2 - MIT license
3 - Apache Software License
4 - GNU General Public License v2 (GPLv2)
5 - GNU General Public License v2 or later (GPLv2+)
6 - GNU General Public License v3 (GPLv3)
7 - GNU General Public License v3 or later (GPLv3+)
8 - Other
Choose from 1, 2, 3, 4, 5, 6, 7, 8 (1, 2, 3, 4, 5, 6, 7, 8) [1]: 1
Select gui_framework:
1 - Toga
2 - None
Choose from 1, 2 (1, 2) [1]: 1
(venv)
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial
$ cd helloworld/
(venv)
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial/helloworld
$ cat helloworld/app.py
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
class HelloWorld(toga.App):
def startup(self):
# Create a main window with a name matching the app
self.main_window = toga.MainWindow(title=self.name)
# Create a main content box
main_box = toga.Box()
# Add the content on the main window
self.main_window.content = main_box
# Show the main window
self.main_window.show()
def main():
return HelloWorld('Hello World', 'com.example.helloworld')
(venv)
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial/helloworld
$ python setup.py windows -s
running windows
* Writing application template...
Template Python-Windows-template succesfully updated.
Project template: C:\Users\IEUser/.cookiecutters/Python-Windows-template
* Determining best support package...
* Installing support package...
Support package: https://www.python.org/ftp/python/3.6.7/python-3.6.7-embed-amd64.zip
Traceback (most recent call last):
File "setup.py", line 79, in <module>
'toga-django==0.3.0.dev11',
File "C:\Users\IEUser\tutorial\venv\lib\site-packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "C:\Users\IEUser\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\IEUser\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\IEUser\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\IEUser\tutorial\venv\lib\site-packages\briefcase\app.py", line 489, in run
self.install_support_package()
File "C:\Users\IEUser\tutorial\venv\lib\site-packages\briefcase\app.py", line 435, in install_support_package
filename = download_url(url=self.support_pkg, download_dir=self.download_dir)
File "C:\Users\IEUser\tutorial\venv\lib\site-packages\briefcase\app.py", line 38, in download_url
print('\r{}{} {}%'.format('\u2588' * done, '.' * (50-done), 2*done), end='', flush=True)
File "C:\Users\IEUser\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 1-7: character maps to <undefined>
(venv)
IEUser@MSEDGEWIN10 MINGW64 ~/tutorial/helloworld
$ python setup.py windows -s
running windows
Collecting toga-winforms==0.3.0.dev11
Using cached https://files.pythonhosted.org/packages/5c/63/3f916b1cdf844bd8078101aec3e2c08445fea1cadf0cb8723b37434772dc/toga_winforms-0.3.0.dev11-py3-none-any.whl
Collecting pythonnet (from toga-winforms==0.3.0.dev11)
Downloading https://files.pythonhosted.org/packages/d9/16/e97d10475eb0d8717e294c6261b1c03cbd852163ea79f4605b0a4e07c8cd/pythonnet-2.3.0-cp36-cp36m-win_amd64.whl (59kB)
Collecting toga-core==0.3.0.dev11 (from toga-winforms==0.3.0.dev11)
Using cached https://files.pythonhosted.org/packages/e0/d2/725f505441428638d97cde2eea794a6a328deeec58bfd615fd3a71baa8ad/toga_core-0.3.0.dev11-py3-none-any.whl
Collecting travertino>=0.1.0 (from toga-core==0.3.0.dev11->toga-winforms==0.3.0.dev11)
Using cached https://files.pythonhosted.org/packages/56/3f/f03efe63c2bdc72763ac39777c9ebbab98605ced5c74aefe48b4fa0abb4d/travertino-0.1.2-py3-none-any.whl
Installing collected packages: pythonnet, travertino, toga-core, toga-winforms
Successfully installed pythonnet-2.3.0 toga-core-0.3.0.dev11 toga-winforms-0.3.0.dev11 travertino-0.1.2
Processing c:\users\ieuser\tutorial\helloworld
Installing collected packages: helloworld
Running setup.py install for helloworld: started
Running setup.py install for helloworld: finished with status 'done'
Successfully installed helloworld-0.0.1
Windows Installer XML Toolset Compiler version 3.11.1.2318
Copyright (c) .NET Foundation and contributors. All rights reserved.
briefcase.wxs
Windows Installer XML Toolset Linker version 3.11.1.2318
Copyright (c) .NET Foundation and contributors. All rights reserved.
* Updating user code...
* Installing requirements...
No requirements.
* Installing platform requirements...
* Installing project code...
* No icons defined - using default...
* No splash screen defined...
* Finalizing application installer script...
Installation complete.
* Looking for WiX Toolset...
- Using C:\Program Files (x86)\WiX Toolset v3.11\
* Compiling application installer...
* Linking application installer...
Build complete.
* Starting Hello World...
error: [WinError 267] The directory name is invalid
Is the error UnicodeEncodeError: 'charmap' codec can't encode characters in position 1-7: character maps to <undefined>
related with the error: [WinError 267] The directory name is invalid
or they are two different issues?
In both cases, am I doing something wrong or is it something I could do to fix this?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (8 by maintainers)
@CurtlyCritchlow I submitted a new issue #198 to cover the error you are getting about the zip file being corrupted.
@murilopolese I fixed the error you were getting about https://github.com/pybee/Python-Windows-template having no 3.7 branch, by creating a 3.7 branch. I am also getting the same unicode errors unfortunately with MSYS2, I think this may be an issue with the mintty console and I logged a new issue there https://github.com/mintty/mintty/issues/855
Interesting - it looks like the problem is the progress meter. Your Windows console doesn’t support Unicode, and as a result, it can’t print the progress bar for downloads. I’m guessing this causes the download to fail, but leaves a partially downloaded file which causes future executions to fail.
I’m not entirely sure what the fix is here - mostly because Windows isn’t my native platform. What would you normally need to do (either to your code, or to the terminal) to be able to output Unicode characters? The trivial fix would be to change the
\u2588
character to something else (like ‘=’), but it seems like there should be something else that can be done…