René's URL Explorer Experiment


Title: Unable to import module · Issue #299 · extrabacon/python-shell · GitHub

Open Graph Title: Unable to import module · Issue #299 · extrabacon/python-shell

X Title: Unable to import module · Issue #299 · extrabacon/python-shell

Description: The Question: Hi, I'm trying out python-shell in a next.js project and I wasn't able to import my local python module in the script. const messages = await PythonShell.runString(`from example_module import a, b, c`); I'm using a pyprojec...

Open Graph Description: The Question: Hi, I'm trying out python-shell in a next.js project and I wasn't able to import my local python module in the script. const messages = await PythonShell.runString(`from example_modul...

X Description: The Question: Hi, I'm trying out python-shell in a next.js project and I wasn't able to import my local python module in the script. const messages = await PythonShell.runString(`from examp...

Opengraph URL: https://github.com/extrabacon/python-shell/issues/299

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to import module","articleBody":"\u003c!--If you are having a problem inside your python code please do not create a issue here. \r\nPython-shell just runs your python code, it is not responsible for any errors in the code itself.--\u003e\r\n\r\n**The Question**:\r\nHi, \r\n\r\nI'm trying out python-shell in a next.js project and I wasn't able to import my local python module in the script. \r\n\r\n```ts\r\nconst messages = await PythonShell.runString(`from example_module import a, b, c`);\r\n```\r\n\r\nI'm using a `pyproject.toml` at the project root to define the local module:\r\n\r\n```toml\r\n[tool.poetry]\r\npackages = [{include = \"example_module\", from = \"python\"}]\r\n\r\n[tool.poetry.dependencies]\r\npython = \"\u003e=3.11,\u003c3.13\"\r\nbayesian = {path = \"./python/example_module\", develop = true }\r\n```\r\n\r\nThis is the error I'm seeing.\r\n\r\n```bash\r\n- error TypeError [ERR_INVALID_ARG_TYPE]: The \"string\" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of PythonShellError\r\n    at new NodeError (node:internal/errors:399:5)\r\n    at Function.byteLength (node:buffer:793:11)\r\n    at apiRes.end \r\n    at handler \r\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {\r\n  digest: undefined\r\n}\r\nPythonShellError: ModuleNotFoundError: No module named 'example_module'\r\n    at PythonShell.parseError\r\n    at terminateIfNeeded\r\n    at ChildProcess.\u003canonymous\u003e\r\n    at ChildProcess.emit\r\n    at ChildProcess._handle.onexit\r\n    ----- Python Traceback -----\r\n    File \"/var/folders/rn/fvrs2khs7hq_hb99d7sqj_0h0000gn/T/pythonShellFile5599925788.py\", line 2, in \u003cmodule\u003e\r\n      from example_module import a, b, c{\r\n  traceback: 'Traceback (most recent call last):\\n' +\r\n    '  File \"/var/folders/rn/fvrs2khs7hq_hb99d7sqj_0h0000gn/T/pythonShellFile5599925788.py\", line 2, in \u003cmodule\u003e\\n' +\r\n    '    from example_module import a, b, c\\n' +\r\n    \"ModuleNotFoundError: No module named 'example_module'\\n\",\r\n  executable: 'python3',\r\n  options: null,\r\n  script: '/var/folders/rn/fvrs2khs7hq_hb99d7sqj_0h0000gn/T/pythonShellFile5599925788.py',\r\n  args: null,\r\n  exitCode: 1,\r\n  logs: []\r\n}\r\n```\r\n\r\nAny suggestion is appreciated. Thank you so much.\r\n","author":{"url":"https://github.com/DawChihLiou","@type":"Person","name":"DawChihLiou"},"datePublished":"2023-08-16T13:28:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/299/python-shell/issues/299"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d0ef07b5-5279-d9d6-037e-d8e259887df8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCE7A:308A8E:330D1AC:4241D76:6974ED73
html-safe-nonce277889e56978e99359be67f70c21e8877f3ae5081a1774d83e780a73313ffd32
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTdBOjMwOEE4RTozMzBEMUFDOjQyNDFENzY6Njk3NEVENzMiLCJ2aXNpdG9yX2lkIjoiNjU0NjI3MzIxNTk4NTI4MjQxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfd4b4f1b73b03a6fcd203112b47e2b19171940b18e844cf28869fc927111be9e
hovercard-subject-tagissue:1853248947
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/extrabacon/python-shell/299/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f8902083fb1be41ff1c1df99b6c76b24a1278a7ac088bb587610896e2adb7ce9/extrabacon/python-shell/issues/299
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f8902083fb1be41ff1c1df99b6c76b24a1278a7ac088bb587610896e2adb7ce9/extrabacon/python-shell/issues/299
og:image:altThe Question: Hi, I'm trying out python-shell in a next.js project and I wasn't able to import my local python module in the script. const messages = await PythonShell.runString(`from example_modul...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDawChihLiou
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/extrabacon/python-shell git https://github.com/extrabacon/python-shell.git
octolytics-dimension-user_id1558613
octolytics-dimension-user_loginextrabacon
octolytics-dimension-repository_id17671651
octolytics-dimension-repository_nwoextrabacon/python-shell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17671651
octolytics-dimension-repository_network_root_nwoextrabacon/python-shell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/extrabacon/python-shell/issues/299#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fextrabacon%2Fpython-shell%2Fissues%2F299
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fextrabacon%2Fpython-shell%2Fissues%2F299
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=extrabacon%2Fpython-shell
Reloadhttps://patch-diff.githubusercontent.com/extrabacon/python-shell/issues/299
Reloadhttps://patch-diff.githubusercontent.com/extrabacon/python-shell/issues/299
Reloadhttps://patch-diff.githubusercontent.com/extrabacon/python-shell/issues/299
extrabacon https://patch-diff.githubusercontent.com/extrabacon
python-shellhttps://patch-diff.githubusercontent.com/extrabacon/python-shell
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fextrabacon%2Fpython-shell
Fork 221 https://patch-diff.githubusercontent.com/login?return_to=%2Fextrabacon%2Fpython-shell
Star 2.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fextrabacon%2Fpython-shell
Code https://patch-diff.githubusercontent.com/extrabacon/python-shell
Issues 55 https://patch-diff.githubusercontent.com/extrabacon/python-shell/issues
Pull requests 5 https://patch-diff.githubusercontent.com/extrabacon/python-shell/pulls
Actions https://patch-diff.githubusercontent.com/extrabacon/python-shell/actions
Projects 0 https://patch-diff.githubusercontent.com/extrabacon/python-shell/projects
Wiki https://patch-diff.githubusercontent.com/extrabacon/python-shell/wiki
Security 0 https://patch-diff.githubusercontent.com/extrabacon/python-shell/security
Insights https://patch-diff.githubusercontent.com/extrabacon/python-shell/pulse
Code https://patch-diff.githubusercontent.com/extrabacon/python-shell
Issues https://patch-diff.githubusercontent.com/extrabacon/python-shell/issues
Pull requests https://patch-diff.githubusercontent.com/extrabacon/python-shell/pulls
Actions https://patch-diff.githubusercontent.com/extrabacon/python-shell/actions
Projects https://patch-diff.githubusercontent.com/extrabacon/python-shell/projects
Wiki https://patch-diff.githubusercontent.com/extrabacon/python-shell/wiki
Security https://patch-diff.githubusercontent.com/extrabacon/python-shell/security
Insights https://patch-diff.githubusercontent.com/extrabacon/python-shell/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/extrabacon/python-shell/issues/299
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/extrabacon/python-shell/issues/299
Unable to import modulehttps://patch-diff.githubusercontent.com/extrabacon/python-shell/issues/299#top
questionhttps://github.com/extrabacon/python-shell/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/DawChihLiou
https://github.com/DawChihLiou
DawChihLiouhttps://github.com/DawChihLiou
on Aug 16, 2023https://github.com/extrabacon/python-shell/issues/299#issue-1853248947
questionhttps://github.com/extrabacon/python-shell/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.