Open jo47011 opened 4 years ago
Did you use cookiecutter
to create your component, and made sure to be inside path/to/your/project/xxx_frontend
? Note that there's a folder xxx_frontend
and also xxx_frontend/xxx_frontend
which can be confusing.
I just used the cookiecutter to create my project and tried running dash-generate-components
inside Windows 10's terminal. My init file was in the correct directly and I was able to run usage.py
without any problem.
Here's what my terminal looks like:
C:\Users\xhlu\dev>cd my_dash_component
C:\Users\xhlu\dev\my_dash_component>venv\Scripts\activate
(venv) C:\Users\xhlu\dev\my_dash_component>dash-generate-components ./src/lib/components my_dash_component -p package-info.json
Generated MyDashComponent.py
(venv) C:\Users\xhlu\dev\my_dash_component>dir
Directory of C:\Users\xhlu\dev\my_dash_component
01/25/2021 03:35 PM <DIR> .
01/25/2021 03:35 PM <DIR> ..
01/25/2021 03:33 PM 445 .babelrc
01/25/2021 03:33 PM 31 .eslintignore
01/25/2021 03:33 PM 3,545 .eslintrc
01/25/2021 03:33 PM 4,890 .gitignore
01/25/2021 03:33 PM 307 .npmignore
01/25/2021 03:33 PM 110 .prettierrc
01/25/2021 03:33 PM 17,355 .pylintrc
01/25/2021 03:35 PM 545 .Rbuildignore
01/25/2021 03:33 PM 225 CONTRIBUTING.md
01/25/2021 03:35 PM <DIR> deps
01/25/2021 03:35 PM 251 DESCRIPTION
01/25/2021 03:33 PM 214 index.html
01/25/2021 03:35 PM <DIR> inst
01/25/2021 03:33 PM 0 LICENSE
01/25/2021 03:35 PM <DIR> man
01/25/2021 03:33 PM 252 MANIFEST.in
01/25/2021 03:35 PM <DIR> my_dash_component
01/25/2021 03:35 PM 66 NAMESPACE
01/25/2021 03:35 PM <DIR> node_modules
01/25/2021 03:35 PM 440,089 package-lock.json
01/25/2021 03:35 PM 1,687 package.json
01/25/2021 03:35 PM 238 Project.toml
01/25/2021 03:33 PM 152 pytest.ini
01/25/2021 03:35 PM <DIR> R
01/25/2021 03:33 PM 3,772 README.md
01/25/2021 03:33 PM 58 requirements.txt
01/25/2021 03:33 PM 3,343 review_checklist.md
01/25/2021 03:33 PM 533 setup.py
01/25/2021 03:35 PM <DIR> src
01/25/2021 03:33 PM <DIR> tests
01/25/2021 03:33 PM 546 usage.py
01/25/2021 03:33 PM <DIR> venv
01/25/2021 03:33 PM 2,215 webpack.config.js
01/25/2021 03:33 PM 366 webpack.serve.config.js
01/25/2021 03:33 PM 1,726 _validate_init.py
26 File(s) 482,961 bytes
11 Dir(s) 665,871,785,984 bytes free
(venv) C:\Users\xhlu\dev\my_dash_component>python usage.py
Dash is running on http://127.0.0.1:8050/
* Serving Flask app "usage" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Hi,
I've created a new dash-component-boilerplate no changes made.
When calling
dash-generate-components
as below the__init__.py
is created in the toplevel directory.dash-generate-components ./src/lib/components xxx_frontend -p package-info.json
Thus running
python usage.py
results inAttributeError: module 'xxx_frontend' has no attribute 'XxxFrontend'
When I mannually move the
__init__.py
to the _xxxfrontend folder it works.Downloaded the latest dash-component-boilerplate version as of today.
Thanks a lot for any help.
For completeness here is the content of the toplevel directory:
Note: even this is a unix listing I am running the software in Windows 10.