<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074614#M2976</link>
    <description>&lt;P&gt;Ok, got this to work in 2022 with some help from the internet.&amp;nbsp;&lt;BR /&gt;Two things:&lt;BR /&gt;&lt;BR /&gt;echoOutput needs to be False:&lt;BR /&gt;cmds.commandPort(name=":7002", sourceType="python", echoOutput=&lt;STRONG&gt;False&lt;/STRONG&gt;)&lt;BR /&gt;&lt;BR /&gt;and anything you send it needs to be bytes&lt;BR /&gt;ie:&lt;BR /&gt;&lt;BR /&gt;cube = b'cmds.polyCube()'&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2022 17:58:56 GMT</pubDate>
    <dc:creator>Mark.Bailey9RLE7</dc:creator>
    <dc:date>2022-03-31T17:58:56Z</dc:date>
    <item>
      <title>Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10917197#M2970</link>
      <description>&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I'm attempting to send MEL commands to Maya via my &lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://www.elgato.com/en/stream-deck" target="_blank" rel="noopener"&gt;Stream Deck&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt; using &lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://help.autodesk.com/view/MAYAUL/2022/ENU/index.html?contextId=COMMANDSPYTHON-INDEX" target="_blank" rel="noopener"&gt;commandPort&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;, but I'm getting &lt;/SPAN&gt;&lt;STRONG&gt;TypeError: a bytes-like object is required, not 'str'&lt;/STRONG&gt;&lt;SPAN&gt;. What am I doing wrong?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 720, in __init__
self.handle()
# TypeError: a bytes-like object is required, not 'str'
# ----------------------------------------
# ----------------------------------------
# Exception happened during processing of request from ('127.0.0.1', 54756)
# Traceback (most recent call last):
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\maya\app\general\CommandPort.py", line 134, in handle
self.wfile.write(self.server.commandMessageQueue.get() + self.resp_term)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 799, in write
self._sock.sendall(b)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Here's my &lt;/SPAN&gt;&lt;STRONG&gt;userSetup.mel&lt;/STRONG&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;commandPort -name "localhost:7001" -sourceType "mel" -echoOutput;
commandPort -name "localhost:7002" -sourceType "python" -echoOutput;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Here's my &lt;/SPAN&gt;&lt;STRONG&gt;command.py&lt;/STRONG&gt;&lt;SPAN&gt; example:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import socket
HOST = '127.0.0.1'	
PORT = 7001
ADDR=(HOST,PORT)
def SendCommand():
    client = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
    client.connect(ADDR)
    command = 'polyCube'
    client.send(command)
    client.close()

if __name__=='__main__':
    SendCommand()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;And here's how I send the command to Maya:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;C:\Python39\python.exe "D:\3D\Maya\SCRIPTS\command.py"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I'd be so thankful if someone could help me get past this error ... I'm so close reaching Maya/Stream Deck nirvana.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;(Maya 2022.3 / Windows 10)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 30 Jan 2022 22:42:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10917197#M2970</guid>
      <dc:creator>Henrik_Cederblad</dc:creator>
      <dc:date>2022-01-30T22:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10917204#M2971</link>
      <description>&lt;P&gt;The thing that looks weird to me, is that ('127.0.0.1', 54756) in the error message. I'm not using port 54756 (this number also seems to differ between launches) ... I'm using 7001 as set in my userSetup.mel and command.py file (?)&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jan 2022 22:30:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10917204#M2971</guid>
      <dc:creator>Henrik_Cederblad</dc:creator>
      <dc:date>2022-01-30T22:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10926722#M2972</link>
      <description>&lt;P&gt;I was told by a person on Reddit that the culprit may be that the command sent to Maya needs to be encoded, by changing the line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    client.send(command)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;client.send(str.encode(command))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... Alas, that results in nothing happening at all; no output in Maya.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, dear community. I need to know the proper way of setting a server up, executing a command via a script and if there's any gothas when invoking that script. E.g. I'm using Python39 to run the script while Maya2022 uses Python37; does that make any difference? ... How do you get this to work? Right now, I'm all at loss here. Not a programmer, but have a desperate need to use my Stream Deck to send commands since &lt;STRONG&gt;I've ran out of bindable hotkeys&lt;/STRONG&gt; in Maya!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 18:04:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10926722#M2972</guid>
      <dc:creator>Henrik_Cederblad</dc:creator>
      <dc:date>2022-02-03T18:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10973676#M2973</link>
      <description>&lt;P&gt;Getting the same error here, trying to send commands from Node using this code :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var net = require('net');
var socketPython;
var pythonPort=7002; 
var mayahost='localhost';
 
socketPython = net.createConnection(pythonPort,mayahost);
socketPython.on('error', function(error) { 
      console.log("Unable to connect to port "+ pythonPort +" on Host "+ mayahost+"  in maya for Python " + error.code);
   });
socketPython.on('data', function(data){
      console.log(data.toString());
  });

socketPython.write("print('Hello')");
socketPython.write('\n');&lt;/LI-CODE&gt;&lt;P&gt;The code I used to open the command port from Maya 2022 (with Python 3.7) :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import maya.cmds as cmds
cmds.commandPort(name=":7002", sourceType="python", echoOutput=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Of course this works with no issue on Maya 2020 (with python 2.7)&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 21:44:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/10973676#M2973</guid>
      <dc:creator>m.oumoumad</dc:creator>
      <dc:date>2022-02-26T21:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074527#M2974</link>
      <description>&lt;P&gt;Did you ever find out what this was? I'm getting the same thing. Code is fine in 2018, borked in 2022.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 17:24:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074527#M2974</guid>
      <dc:creator>Mark.Bailey9RLE7</dc:creator>
      <dc:date>2022-03-31T17:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074529#M2975</link>
      <description>&lt;P&gt;I think that random port number is what the machine uses to communicate once it's finished the initial handshake on the user defined port.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 17:25:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074529#M2975</guid>
      <dc:creator>Mark.Bailey9RLE7</dc:creator>
      <dc:date>2022-03-31T17:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074614#M2976</link>
      <description>&lt;P&gt;Ok, got this to work in 2022 with some help from the internet.&amp;nbsp;&lt;BR /&gt;Two things:&lt;BR /&gt;&lt;BR /&gt;echoOutput needs to be False:&lt;BR /&gt;cmds.commandPort(name=":7002", sourceType="python", echoOutput=&lt;STRONG&gt;False&lt;/STRONG&gt;)&lt;BR /&gt;&lt;BR /&gt;and anything you send it needs to be bytes&lt;BR /&gt;ie:&lt;BR /&gt;&lt;BR /&gt;cube = b'cmds.polyCube()'&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 17:58:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11074614#M2976</guid>
      <dc:creator>Mark.Bailey9RLE7</dc:creator>
      <dc:date>2022-03-31T17:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11386909#M2977</link>
      <description>&lt;P&gt;The reason for this error is that in Python 3, strings are Unicode, but when transmitting on the network, the data needs to be bytes instead. We can convert &lt;A href="http://net-informations.com/python/iq/byte.htm" target="_blank" rel="noopener"&gt;bytes to string&lt;/A&gt; using bytes class decode() instance method, So you need to decode the bytes object to produce a string. In Python 3 , the default encoding is "utf-8" , so you can use directly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;b"python byte to string".decode("utf-8")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Python makes a clear distinction between bytes and strings . Bytes objects contain raw data — a sequence of octets — whereas strings are Unicode sequences . Conversion between these two types is explicit: you encode a string to get bytes, specifying an encoding (which defaults to UTF-8); and you decode bytes to get a string. Clients of these functions should be aware that such conversions may fail, and should consider how failures are handled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 05:29:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11386909#M2977</guid>
      <dc:creator>stevejonn</dc:creator>
      <dc:date>2022-08-29T05:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11410721#M2978</link>
      <description>&lt;P&gt;use this python script to open port in maya&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.cmds as mc 
mc.commandPort(name="127.0.0.1:7002", stp="python", echoOutput=True)
mc.commandPort(name="127.0.0.1:7001", stp="mel", echoOutput=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 09:08:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11410721#M2978</guid>
      <dc:creator>gamidk262</dc:creator>
      <dc:date>2022-09-09T09:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11747855#M2979</link>
      <description>&lt;P&gt;For people facing this issue with Maya 2023, there is a bug in socketserver that makes the commands not work with echoOutput,&lt;BR /&gt;&lt;BR /&gt;Use this python script instead:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.cmds as cmds
cmds.commandPort(name="127.0.0.1:7002", stp="python")
cmds.commandPort(name="127.0.0.1:7001", stp="mel")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also use MEL:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;commandPort -name "localhost:7001" -sourceType "mel";&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Keep in mind you need a new maya instance for this if you have already executed the code. Just do not call for echoOutput.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2023 18:23:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/11747855#M2979</guid>
      <dc:creator>Fuchs_Leyenda</dc:creator>
      <dc:date>2023-02-11T18:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12320790#M2980</link>
      <description>&lt;P&gt;I am trying to send a python print command through VSCode (MayaCode extension) and I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;commandPort -name "localhost:7001" -sourceType "mel";
# ----------------------------------------
# Exception occurred during processing of request from ('127.0.0.1', 52825)
# Traceback (most recent call last):
# #   File "C:\Program Files\Autodesk\Maya2024\Python\lib\socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
# #   File "C:\Program Files\Autodesk\Maya2024\Python\lib\socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
# #   File "C:\Program Files\Autodesk\Maya2024\Python\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
# #   File "C:\Program Files\Autodesk\Maya2024\Python\lib\socketserver.py", line 747, in __init__
    self.handle()
# #   File "C:\Program Files\Autodesk\Maya2024\Python\lib\site-packages\maya\app\general\CommandPort.py", line 134, in handle
    self.wfile.write(self.server.commandMessageQueue.get() + self.resp_term)
# #   File "C:\Program Files\Autodesk\Maya2024\Python\lib\socketserver.py", line 826, in write
    self._sock.sendall(b)
# TypeError: a bytes-like object is required, not 'str'
# ----------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it fixable?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 22:39:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12320790#M2980</guid>
      <dc:creator>klawchi</dc:creator>
      <dc:date>2023-10-20T22:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12675672#M2981</link>
      <description>&lt;P class=""&gt;To debug Python code in Maya 2022 or above using VS Code, you can use the "Debugger for Maya" extension available here:&amp;nbsp;&lt;A href="https://marketplace.visualstudio.com/items?itemName=zhalice2011.mayadebugger" target="_blank" rel="noopener"&gt;https://marketplace.visualstudio.com/items?itemName=zhalice2011.mayadebugger&lt;/A&gt;)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;For guidance on how to use it, check out this video tutorial: (&lt;A href="https://www.youtube.com/watch?v=mIKi2tZP0JM" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=mIKi2tZP0JM&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 06:33:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12675672#M2981</guid>
      <dc:creator>zhalice2012</dc:creator>
      <dc:date>2024-03-30T06:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12809956#M2982</link>
      <description>&lt;P&gt;Quite easy to fix:&lt;BR /&gt;Just make sure you set the ports right in your MayaCode Extension settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="office_0-1717159368357.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1370143iE52AD8ADDE4F3CD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="office_0-1717159368357.png" alt="office_0-1717159368357.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then execute following python command in maya:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.cmds as cmds
cmds.commandPort(name="127.0.0.1:7001", stp="mel")
cmds.commandPort(name="127.0.0.1:7002", stp="python")&lt;/LI-CODE&gt;&lt;P&gt;worked for me.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 12:45:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12809956#M2982</guid>
      <dc:creator>office</dc:creator>
      <dc:date>2024-05-31T12:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12809958#M2983</link>
      <description>&lt;P&gt;Quite easy to fix:&lt;BR /&gt;Just make sure you set the ports right in your MayaCode Extension settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="office_0-1717159368357.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1370143iE52AD8ADDE4F3CD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="office_0-1717159368357.png" alt="office_0-1717159368357.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then execute following python command in maya:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.cmds as cmds
cmds.commandPort(name="127.0.0.1:7001", stp="mel")
cmds.commandPort(name="127.0.0.1:7002", stp="python")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;worked for me.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 12:45:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/12809958#M2983</guid>
      <dc:creator>office</dc:creator>
      <dc:date>2024-05-31T12:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Maya 2022.3 – TypeError: a bytes-like object is required, not 'str' when using commandPort</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/13088770#M2984</link>
      <description>&lt;P&gt;Did you try to setting up this code in userSetup.py? Seems to do nothing into my maya.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:34:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-2022-3-typeerror-a-bytes-like-object-is-required-not-str/m-p/13088770#M2984</guid>
      <dc:creator>guido_gonzalezU9EFY</dc:creator>
      <dc:date>2024-10-16T16:34:55Z</dc:date>
    </item>
  </channel>
</rss>

