Giter Site home page Giter Site logo

chapyter's Introduction

Chapyter Logo

Please check our latest blogpost on Chapyter release.

What is Chapyter

Chapyter is a JupyterLab extension that seamlessly connects GPT-4 to your coding environment. It features a code interpreter that can translate your natural language description into Python code and automatically execute it. By enabling "natural language programming" in your most familiar IDE, Chapyter can boost your productivity and empower you to explore many new ideas that you would not have tried otherwise.

Functionality Example
Code generation from natural language and automatic execution
Simply adding the magic command %%chat at the beginning of the cell of a natural language description of the task, the code is generated and the results are shown in a few seconds.
Code generation from natural language and automatic execution
Using coding history and execution output for code generation
By adding the --history or -h flag in generation, chapyter can use the previous execution history and outputs to generate the appropriate visualization for the loaded IRIS dataset.
Using coding history and execution output for code generation
In-situ debugging and code editing
The generated code might not be perfect and could contain bugs or errors. Since Chapyter is fully integrated into Jupyter Notebook, you can easily inspect the code and fix any errors or bugs (e.g., installing missing dependencies in this case) without leaving the IDE.
In-situ debugging and code editing
Transparency on the prompts and AI configuration and allows for customization We release all the prompts used in our library and we are working on easy customization of the used prompts and settings. See in chapyter/programs.py.
Privacy-first when using latest powerful AI Since we are using OpenAI API, all the data sent to OpenAI will not be saved for training (see OpenAI API Data Usage Policies). As a comparison, whenever you are using Copilot or ChatGPT, your data will be somewhat cached and can be used for their training and analysis.

Quick Start

  1. Installation

    pip install chapyter   # Automatically installs the extension to jupyterlab
    pip uninstall chapyter # Uninstalls the extension from jupyterlab

    Note: It will upgrade the jupyterlab to ≥ 4.0. It might break your environments.

  2. Usage: see examples/01-quick-start.ipynb for a starter notebook.

    1. Set the proper OPENAI_API_KEY and OPENAI_ORGANIZATION in the environment variable
    2. Use the magic command %%chat in a code cell:
      %%chat -m gpt-4-0613 
      List all the files in the folder 
      
      It will call gpt-4-0613 to generate the python code for listing all the files in the folder, and execute the generated code automatically. In this case, this plugin serves as the interpreter that translates the natural language to python code and execute it.
  3. Examples:

    • examples/01-quick-start.ipynb illustrates the basic functions of chapyter, including how to use the magic command %%chat
    • examples/02-configure-chapyter.ipynb shows how to customize chapyter:
      • Use different default models (e.g., gpt-3.5-turbo instead of gpt-4)
      • Use different types of API (now we support use the default OpenAI API or the Azure OpenAI API)

Development Notes

There are two major components in Chapyter: implementing the ipython magic command that handles the prompting and calling GPT-X models, and the frontend that listens to Chapyter cell execution and automatically executes the newly generated cell and updates the cell styles. The chart below illustrates the orchestration of the frontend and ipython kernel after a Chapyter cell is executed.

implementation

Details

  1. NodeJS is needed to build the extension package.

  2. The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

    # Clone the repo to your local environment
    # Change directory to the chapyter directory
    # Install package in development mode
    pip install -e "."
    # Link your development version of the extension with JupyterLab
    jupyter labextension develop . --overwrite
    # Rebuild extension Typescript source after making changes
    jlpm build
  3. You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

    # Watch the source directory in one terminal, automatically rebuilding when needed
    jlpm watch
    # Run JupyterLab in another terminal
    jupyter lab

    With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

  4. By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

    jupyter lab build --minimize=False
  5. Packaging and release: please refer to RELEASE.

chapyter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chapyter's Issues

Environment variable OPEN_AI_KEY not found by

I'm running JupyterLab 4.0.4 on a Mac and trying to use Chapyter.
I have an environment variable OPEN_AI_KEY set and can check this by: echo $OPENAI_API_KEY

Chapyter is installed and in my first cell I have:

%load_ext chapyter

And then:

%%chat
add numbers from 1 to 10

I get this error:
assert openai.api_key is not None, "You must provide an OpenAI API key to use the OpenAI LLM. Either pass it in the constructor, set the OPENAI_API_KEY environment variable, or create the file ~/.openai_api_key with your key in it."

Error communicating with OpenAI when use proxy.

Why can’t the server be accessed using a proxy?

The exception msg:
image

The https proxy has already been set in the proxy settings, as follows:
image

Other test programs can responsed normally by directly calling the API using request, as follows:
image

Can anyone help solve this problem? Thanks so much~~

No output in Google Colab

I'm trying to run Chapyter in Google Colab. After installing with pip and setting the api keys,
the %load_ext chapyter works, but when I try to run something with %chat, the command returns no output.

KeyError: 'Could not automatically map gpt-4 to a tokeniser. Please use `tiktok.get_encoding` to explicitly get the tokeniser you expect.'

I tried a basic test of chapyter but it errors:

%load_ext chapyter

%%chat
hello

Trace:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[2], line 1
----> 1 get_ipython().run_cell_magic('chat', '', '\nhello\n')

File ~/miniconda/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2430, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
   2428 with self.builtin_trap:
   2429     args = (magic_arg_s, cell)
-> 2430     result = fn(*args, **kwargs)
   2432 # The code below prevents the output from being displayed
   2433 # when using magics with decodator @output_can_be_silenced
   2434 # when the last Python token in the expression is a ';'.
   2435 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/miniconda/lib/python3.10/site-packages/chapyter/magic.py:183, in Chapyter.chat(self, line, cell)
    180     return
    181 current_message = cell
--> 183 program_out = self.agent.execute_chat(current_message, args, self.shell)
    184 execution_id = self.shell.execution_count
    185 program_out = f"# Assistant Code for Cell [{execution_id}]:\n" + program_out

File ~/miniconda/lib/python3.10/site-packages/chapyter/magic.py:114, in ChapyterAgent.execute_chat(self, message, args, shell, **kwargs)
    106 def execute_chat(
    107     self,
    108     message: str,
   (...)
    111     **kwargs,
    112 ):
    113     program = self.get_program(args, kwargs.get("chatonly", False))
--> 114     llm = self.load_model(args, program)
    116     response = program.execute(
    117         message=message,
    118         llm=llm,
   (...)
    121         **kwargs,
    122     )
    123     return response

File ~/miniconda/lib/python3.10/site-packages/chapyter/magic.py:74, in ChapyterAgent.load_model(self, args, program)
     71 if program.model_name is not None:
     72     model_name = program.model_name
---> 74 return self._load_model(model_name)

File ~/miniconda/lib/python3.10/site-packages/chapyter/magic.py:61, in ChapyterAgent._load_model(self, model_name)
     60 def _load_model(self, model_name: Optional[str]) -> guidance.llms.LLM:
---> 61     model = guidance.llms.OpenAI(
     62         model_name, organization=os.environ["OPENAI_ORGANIZATION"]
     63     )
     64     # TODO: Support Azure models
     65     return model

File ~/miniconda/lib/python3.10/site-packages/guidance/llms/_openai.py:178, in OpenAI.__init__(self, model, caching, max_retries, max_calls_per_min, api_key, api_type, api_base, api_version, deployment_id, temperature, chat_mode, organization, rest_call, allowed_special_tokens, token, endpoint)
    175     api_base = os.environ.get("OPENAI_API_BASE", None) or os.environ.get("OPENAI_ENDPOINT", None) # ENDPOINT is deprecated
    177 import tiktoken
--> 178 self._tokenizer = tiktoken.get_encoding(tiktoken.encoding_for_model(model).name)
    179 self.chat_mode = chat_mode
    181 self.allowed_special_tokens = allowed_special_tokens

File ~/miniconda/lib/python3.10/site-packages/tiktoken/model.py:68, in encoding_for_model(model_name)
     65             return get_encoding(model_encoding_name)
     67 if encoding_name is None:
---> 68     raise KeyError(
     69         f"Could not automatically map {model_name} to a tokeniser. "
     70         "Please use `tiktok.get_encoding` to explicitly get the tokeniser you expect."
     71     ) from None
     73 return get_encoding(encoding_name)

KeyError: 'Could not automatically map gpt-4 to a tokeniser. Please use `tiktok.get_encoding` to explicitly get the tokeniser you expect.'

Uable to add use %chapyter openai_api_org = 'value'

Hi there, I want to configure the chapyter. However, when I use %chapyter openai_api_org = 'org-myorg', it's said that:

UsageError: Invalid usage of the chapyter command: openai_api_org = 'org-PrhJLJTejKb36yGXRldiR9RT'. It supports the following usage:

  • %chapyter
    print all the configurable parameters and its current value
  • %chapyter <parameter_name>
    print the current value of the parameter
  • %chapyter <parameter_name>=
    set the value of the parameter

No output in JetBrains IDEs

There's no output appearing when used in the Notebook UI in any of the JetBrains IDEs. I assume this is related to #24 but just noting here in case it needs to be handled separately.

Cannot connect to host api.openai.com:443 ssl:default

Traceback (most recent call last):
File "E:\anaconda\Lib\site-packages\aiohttp\connector.py", line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\asyncio\base_events.py", line 1085, in create_connection
raise exceptions[0]
File "E:\anaconda\Lib\asyncio\base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\asyncio\base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "E:\anaconda\Lib\asyncio\selector_events.py", line 634, in sock_connect
return await fut
^^^^^^^^^
File "E:\anaconda\Lib\asyncio\futures.py", line 287, in await
yield self # This tells Task to wait for completion.
^^^^^^^^^^
File "E:\anaconda\Lib\asyncio\tasks.py", line 339, in __wakeup
future.result()
File "E:\anaconda\Lib\asyncio\futures.py", line 203, in result
raise self._exception.with_traceback(self._exception_tb)
File "E:\anaconda\Lib\asyncio\selector_events.py", line 674, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 10060] Connect call failed ('199.59.148.6', 443)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\openai\api_requestor.py", line 668, in arequest_raw
result = await session.request(**request_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\site-packages\aiohttp\client.py", line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\site-packages\aiohttp\connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\site-packages\aiohttp\connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection
raise last_exc
File "E:\anaconda\Lib\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\anaconda\Lib\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.openai.com:443 ssl:default [Connect call failed ('199.59.148.6', 443)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 109, in run
await self.visit(self.parse_tree, VariableStack([self.program._variables], self))
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 524, in visit
command_output = await command_function(*positional_args, **named_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance\library_assistant.py", line 13, in assistant
return await role(role_name="assistant", hidden=hidden, _parser_context=_parser_context, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance\library_role.py", line 17, in role
new_content += await parser.visit(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 266, in visit
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 266, in
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance_program_executor.py", line 379, in visit
command_output = await command_function(*positional_args, **named_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance\library_gen.py", line 140, in gen
gen_obj = await parser.llm_session(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance\llms_openai.py", line 665, in call
out = await self.llm.caller(**call_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\guidance\llms_openai.py", line 370, in _library_call
out = await openai.ChatCompletion.acreate(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\openai\api_resources\chat_completion.py", line 45, in acreate
return await super().acreate(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 217, in acreate
response, _, api_key = await requestor.arequest(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\openai\api_requestor.py", line 372, in arequest
result = await self.arequest_raw(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\63268\AppData\Roaming\Python\Python311\site-packages\openai\api_requestor.py", line 685, in arequest_raw
raise error.APIConnectionError("Error communicating with OpenAI") from e
openai.error.APIConnectionError: Error communicating with OpenAI

Error in program: Error communicating with OpenAI

install: Could not build wheels for guidance

Not able to install using pip on Apple MacBook Pro M3

$ pip install chapyter

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c guidance/_cpp/byte_trie.cpp -o build/temp.macosx-10.9-universal2-cpython-311/guidance/_cpp/byte_trie.o -std=c++17 -fvisibility=hidden -g0
      In file included from guidance/_cpp/byte_trie.cpp:1:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/stl.h:12:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:13:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/class.h:12:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/../attr.h:13:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/common.h:266:
      In file included from /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:23:
      /opt/local/libexec/llvm-16/bin/../include/c++/v1/stdlib.h:150:34: error: unknown type name 'ldiv_t'
      inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                       ^
      /opt/local/libexec/llvm-16/bin/../include/c++/v1/stdlib.h:151:12: error: no member named 'ldiv' in the global namespace
        return ::ldiv(__x, __y);
               ~~^
      /opt/local/libexec/llvm-16/bin/../include/c++/v1/stdlib.h:154:34: error: unknown type name 'lldiv_t'
      inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                       ^
      /opt/local/libexec/llvm-16/bin/../include/c++/v1/stdlib.h:156:12: error: no member named 'lldiv' in the global namespace
        return ::lldiv(__x, __y);
               ~~^
      In file included from guidance/_cpp/byte_trie.cpp:1:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/stl.h:12:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:13:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/class.h:12:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/../attr.h:13:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/common.h:266:
      In file included from /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:26:
      /opt/local/libexec/llvm-16/bin/../include/c++/v1/string.h:95:102: error: unknown type name 'size_t'
      inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const void* memchr(const void* __s, int __c, size_t __n) {
                                                                                                           ^
      /opt/local/libexec/llvm-16/bin/../include/c++/v1/string.h:98:90: error: unknown type name 'size_t'
      inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD void* memchr(void* __s, int __c, size_t __n) {
                                                                                               ^
      In file included from guidance/_cpp/byte_trie.cpp:1:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/stl.h:12:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:13:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/class.h:12:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/../attr.h:13:
      In file included from /private/var/folders/c3/gnpb2cfd5znckvplsjxhcy2r0000gn/T/pip-build-env-8oikvw4w/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/detail/common.h:266:
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:29:12: fatal error: 'unistd.h' file not found
      #  include <unistd.h>
                 ^~~~~~~~~~
      7 errors generated.
      error: command '/opt/local/libexec/llvm-16/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for guidance
Failed to build guidance
ERROR: Could not build wheels for guidance, which is required to install pyproject.toml-based projects

System Info:

import platform

print(platform.machine())
print(platform.version())
print(platform.platform())
print(platform.uname())
print(platform.system())

arm64
Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:59 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6030
macOS-14.3.1-arm64-arm-64bit
uname_result(system='Darwin', node='Marks-MacBook-Pro.local', release='23.3.0', version='Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:59 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6030', machine='arm64')
Darwin
arm

Why is %load_ext necessary?

This may be a Python or Jupyter question but I've never encountered this before with an extension so just asking here in case it's related. Why do I need %load_ext chapyter? I've used lots of extensions and have never encountered the need for %load_ext before. Most (all) load automatically just by being installed with pip.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.